Search code examples
c#xamarinmacos-sierranib

Could not load the nibName issue (xamarin)


We start to prepare project with generic solution for few apps using Xamarin studio (the idea is to let all our apps use same "Core" components).

We started from preparing general "Core" with base functionality. Also we add "subCore" - libraries with functionality specific to each platform (iOS, android, windows etc).

Currently setup such structure for Android and iOS.

During second step of implementation for macOS, we faced with few blocking points.

The problem appear when we try to configure (in way described above) structure for macOS platform.

I was able to create macOS class Library with components that should be reused in apps (for now this is just 1 class with xib file). But, when I want to use this package (with xib inside) in macOS target, got exception:

External Modification Warnings: Debugger attached to process.

Application Specific Information: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[NSNib _initWithNibNamed:bundle:options:] could not load the nibName: MainViewController in bundle (null).' terminating with uncaught exception of type NSException abort() called

After some investigating, found that Mac Build server is not converting xibs into nibs, so this nib file is just missing in package created by Xamarin.

Additional testing info, based on proposed solutions found in Xamarin forum:

  • rename, recreate, reposition of xib file in project - not resolve the issue
  • recreate project - not resolve the issue
  • check Build action in property is set to InterfaceDefinition (also check all other possible variants) - not resolve the issue

I found this post, with root cause exactly as I have:

Mac Build server is not converting xibs into nibs.

According to discussion on this post, issue should be fixed, but I still faced with this.

Can some one advice how to fix described problem?


Solution

  • To anyone who faced same issue, please install

    xamarin.ios-10.13.0.27.pkg

    and

    xamarin.mac-3.7.0.27.pkg

    This build include fix for described problem.

    For more, visit this page.