4

I'm Binding to an Objective-C native library with Xamarin Custom Bindings.
I got the whole application working in Visual Studio with the generated DLL.
I also added the bundle (of the library I'm binding to) and marked the images and nib's inside it as "Bundle Resources".

But when I run the App the nib's don't get copied at all to the Simulator/Device.
I know the app/binding is fine because if I manually copy the nib and images the app works as expected.

I have already tried configuring several locations for the bundle folder but none of them worked:
- VSProjectFolder/Resources/miAssetKit.bundle/*
- VSProjectFolder/Resources/*
- VSProjectFolder/miAssetKit.bundle/*

(I also edited the csproj file to add the "miAssetKit.bundle" Resource Reference instead of the Resources in this last try.)

This is the error I get when using the "VSProjectFolder/Resources/miAssetKit.bundle/" location

2014-08-07 12:01:42.832 KPIBindingiOS[4771:70b] @ monotouch: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Could not load NIB in bundle: 'NSBundle (not yet loaded)' with name 'miKpiValueViewController'

Looking at the mtbserver.log I have this error:

[07-Aug-2014 14:40:32] Warning: Fail moving file /Users/Manish/Library/Caches/Xamarin/mtbs/builds/KPIBindingiOS/decba649-b058-4744-bbb3-22ca560a321e/output/Debug/iPhoneSimulator/KPIBindingiOS.app/miScatterPlotPopView.nib to bundle dir: /Users/Manish/Library/Caches/Xamarin/mtbs/builds/KPIBindingiOS/decba649-b058-4744-bbb3-22ca560a321e/bundle/KPIBindingiOS.app/miScatterPlotPopView.nib [07-Aug-2014 14:40:32] Warning: Exception type: System.IO.FileNotFoundException /Users/Manish/Library/Caches/Xamarin/mtbs/builds/KPIBindingiOS/decba649-b058-4744-bbb3-22ca560a321e/output/Debug/iPhoneSimulator/KPIBindingiOS.app/miScatterPlotPopView.nib does not exist

Dinis Vieira
  • 295
  • 1
  • 15
  • 1
    Sorry - I don't have the answer but from an emotional perspective, maybe it would help to know you're not alone. If I figure it out first, I'll be back. – Timothy Lee Russell Sep 20 '14 at 22:52
  • @TimothyLeeRussell I still haven't managed to get this working, but I found a workaround. If you copy your entire project to a Mac, and open it with Xamarin Studio it will work (deploy) just fine. I'm guessing it's a Visual Studio + Xamarin Issue. – Dinis Vieira Sep 21 '14 at 03:16
  • 1
    I have a paid subscription and put in a bug report to Xamarin support. I'll let you know what I find out. – Timothy Lee Russell Sep 21 '14 at 05:48
  • I thought you needed .xib files inside your solution? At least, that's what I use. I have .xib (empty views) files from Xcode inside my project's solution, that I use to dynamically create all UI controls. – Magicbjørn Apr 01 '15 at 11:06

1 Answers1

0

Try moving the .xib files to the iOS project and setting the build action to "Interface Definition". It just worked for me.

yairsz
  • 438
  • 5
  • 15