Debug from Visual Studio : Can't load nib

DirkRaesDirkRaes USMember

Hello,

I run into the following problem. When I debug our app from Visual Studio 2012 the app crashes on startup on:
MonoTouch.Foundation.NSBundle.MainBundle.LoadNib("InputTableViewCell", this, null);

The exception I get is:
MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Could not load NIB in bundle

When I debug the same app from Xamarin Studio 2.0 on a mac, the app runs just fine. Am I missing something?

Thanks for answering in advance :)

Posts

  • LemcubeLemcube ITBeta, University ✭✭

    The same problem for me.

    I've a dll library project with a xib in it. The xib has set the build action to InterfaceDefinition correctly.

    The same solution works locally in the emulator with xamarin studio on mac but doesn't work in VisualStudio2012 (same exception reported by Vincent)

  • DirkRaesDirkRaes USMember

    I've a dll library project with a xib in it. The xib has set the build action to InterfaceDefinition correctly.

    Yes, this is the case for me too. It's a dll library with a xib in it.

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    Hi @VincentJunemann

    Try to change the Build Action of xib inside the DLL project, to EmbeddedResource

  • DirkRaesDirkRaes USMember

    Hello @Jarina

    I set the BuildAction of the xib's in the DLL project to EmbeddedResource, but I still get the same error

    MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Could not load NIB in bundle: 'NSBundle </Users/admin/Library/Application Support/iPhone Simulator/6.0/Applications/248E9E58-B153-4091-9808-255404A7368C/MobileHR.app> (loaded)' with name 'InputTableViewCell'

    I also tried setting it to "Content". It still works on Xamarin Studio 2.0 btw.

  • DirkRaesDirkRaes USMember

    Anyone? :(

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    @VincentJunemann

    Can you check the content of your folder:

    ~/Library/Caches/Xamarin/mtbs/builds/MobileHR/<guid>/output/Debug/iPhoneSimulator/MobileHR.app/
    

    ?

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    Hello @VincentJunemann

    I think I got your issue.

    The Mac Build server is not converting your xibs into nibs.

    To workaround the issue:

    • Add your nib to any iPhone application
    • Debug this application on simulator/device
    • Grab the .nib inside your app bundle
    • Add your .nib to your library as a Embedded Resource.
    • Now you can use your dll with your nib.

    I will fix this on Mac version, so next version should be ok.

    Thank for your report.

  • DirkRaesDirkRaes USMember

    Hi @Jarina

    great. I'll be looking forward to the next update then :)

  • WayneDouglasWayneDouglas GBMember

    Any word on if this is sorted now?

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    Hello @Wayne

    The issue was already fixed, but is not released yet.

    Right now, you need to workaround using http://forums.xamarin.com/discussion/comment/7076/#Comment_7076

  • WayneDouglasWayneDouglas GBMember

    Is this available in the beta channel or is there an estimated date for it's arrival?

  • WayneDouglasWayneDouglas GBMember

    Bump!

  • WayneDouglasWayneDouglas GBMember

    @Jarina - bump ;)

  • AlAl GBMember

    We are also waiting for this release? We are running Xamarin Studio 4.0.4 (build 2), Xcode 4.6 (2066) and Xamarin.iOS 6.2.4.2 on a Mac connected to a PC using Visual Studio 2012 running on Windows 8 and it does not work on this configuration? Like Wayne, we are keen to get this fix.

    Alan

  • This appears to be still not fixed. Quite a serious issue with a premium product.

  • DirkRaesDirkRaes USMember

    I will have to agree that the current release is not workable, even with the "workaround". For now the Visual Studio-plugin for iOS is unfortunatly useless :( Hopefully we get news soon on when the fix is applied to an update!

  • MarianoBeecheMarianoBeeche CRMember

    Ran into something similar. I changed the xib in the Build Action in Visual Studio to InterfaceDefinition and it worked for me.

    Hope this helps

  • AlexandrePepinAlexandrePepin CAMember

    I'm running into the same problem. Any update if this issue is resolved? The workaround is not working for me

  • MarkEntnerMarkEntner USMember, University

    I'm running into this same issue with Xamarin Studio 3. The project runs fine on an iPhone, but it gives the error when running on the simulator. Any ideas?

  • I'm having trouble with this as well.

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai
    edited September 2014
  • could it be that it's still not fixed? I've opened my previously in XS edited solution in VS. When I compile in XS the xib from my library project gets loaded, compiled in VS I get NSInternalConsistencyException

  • I can't believe this is not fixed yet !! it's been a year and it's a pretty serious problem .. I'm having this issue with Visual studio 2013 as well .. Please Help ..

  • KennethThormanKennethThorman DKMember ✭✭

    I just ran into the same problem, please advice on possible workarounds.

  • KoenvanExtelKoenvanExtel NLMember
    edited March 2015

    Same issue here.. The strange thing is, it seems that I'm able to build and run the simulator (from Visual Studio) after I've closed the Xamarin.iOS build host on my mac?

  • BertCortTorrBertCortTorr ESMember

    Same issue here...

  • ThiyagarajanRenganathanThiyagarajanRenganathan USUniversity ✭✭

    Hi Vinicius Jarina,

    We have used Xamarin Studio 5.7, Xamarin.iOS 8.6.0.51 and Visual Studio 2012.Still similar kind of issue raised.
    Could you please let me know whether that issue fixed or not.

    Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Could not load NIB in bundle: 'NSBundle </Users/trengan/Library/Developer/CoreSimulator/Devices/B291F409-B682-433B-B95D-6366135D6D13/data/Containers/Bundle/Application/F3A39900-36D6-4BA3-8DFE-F17C01346FA8/POCVisualStudio.app> (loaded)' with name 'LibController'

  • ThiyagarajanRenganathanThiyagarajanRenganathan USUniversity ✭✭

    If the above issue is fixed,then please share the fixed versions

    Thanks in Advance !!!

    Regards,
    Thiyagarajan

  • ThiyagarajanRenganathanThiyagarajanRenganathan USUniversity ✭✭

    Above problem solved with

    Xamarin.iOS version - 8.9.1.3
    Xamarin.VS version - 3.9.547
    Xcode version – 6.1.1

    Regards,
    R.Thiyagarajan

  • DanieleDaviDanieleDavi USMember

    I have the same problem:

    Xamarin.VS 3.11.1450.0
    Xamarin.iOS 9.0.1.0
    XCode 6.0.1
    udpating XCode to 6.2 the result doesn't change.

Sign In or Register to comment.