This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 38206 - [XI 9.4.1] "NSInvalidArgumentException Reason: Could not find a storyboard named 'Main' in bundle NSBundle", "Could not load NIB in bundle", and other missing resource problems
Summary: [XI 9.4.1] "NSInvalidArgumentException Reason: Could not find a storyboard na...
Status: CLOSED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: XI 9.4 (iOS 9.2)
Hardware: PC Mac OS
: --- major
Target Milestone: C6SR1
Assignee: Bugzilla
URL:
: 37730 38097 38239 (view as bug list)
Depends on: 37837 38238
Blocks:
  Show dependency tree
 
Reported: 2016-01-29 21:13 UTC by Brendan Zagaeski (Xamarin Support)
Modified: 2016-02-01 22:12 UTC (History)
6 users (show)

See Also:
Tags: BZRC6SR1S1_C6S3
Is this bug a regression?: ---
Last known good build:


Attachments
Minimal test case: Microsoft BCL Build NuGet + iOS Class Library (13.71 KB, application/zip)
2016-01-30 00:42 UTC, Brendan Zagaeski (Xamarin Support)
Details

Description Brendan Zagaeski (Xamarin Support) 2016-01-29 21:13:54 UTC
[XI 9.4.1] "NSInvalidArgumentException Reason: Could not find a storyboard named 'Main' in bundle NSBundle", "Could not load NIB in bundle", and other missing resource problems


This is a new bug report to publicly track the status of non-public Bug 37837.




## Regression status: regression in "Cycle 6 – Service Release 1"

BAD:  Xamarin.iOS 9.4.1.23 (7f1cef9)
GOOD: Xamarin.iOS 9.4.0.0  (7322991)




## Example exception message from the Application Output

Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: Could not find a storyboard named 'Main' in bundle NSBundle </Users/macuser/Library/Developer/CoreSimulator/Devices/47C2E1F1-1437-4695-89A2-8CB3878BD026/data/Containers/Bundle/Application/FBAB9059-0A7D-4DD2-9056-F0EA42E63952/UnifiedSingleViewIphone1.app> (loaded)




## More detailed symptoms

There is no Main storyboard in the .app, but it is in the obj directory:

~/Projects/UnifiedSingleViewIphone1/UnifiedSingleViewIphone1  > find . | grep Main
./Main.cs
./Main.storyboard
./MainViewController.cs
./MainViewController.designer.cs
./obj/iPhoneSimulator/Debug/ibtool/Main.storyboardc
./obj/iPhoneSimulator/Debug/ibtool/Main.storyboardc/BYZ-38-t0r-view-8bC-Xf-vdC.nib
./obj/iPhoneSimulator/Debug/ibtool/Main.storyboardc/Info.plist
./obj/iPhoneSimulator/Debug/ibtool/Main.storyboardc/UIViewController-BYZ-38-t0r.nib


(Or to be more precise, the outputs of IBTool task are for some reason not being included in the _CopyResourcesToBundle target.)
Comment 2 Brendan Zagaeski (Xamarin Support) 2016-01-29 21:16:45 UTC
## Status update

A candidate fix for this issue has been committed. Candidate builds that include that fix are in progress. I will update the bug again once a candidate build is available for user testing.
Comment 3 Brendan Zagaeski (Xamarin Support) 2016-01-29 21:21:11 UTC
*** Bug 37730 has been marked as a duplicate of this bug. ***
Comment 4 Brendan Zagaeski (Xamarin Support) 2016-01-29 21:36:22 UTC
*** Bug 38097 has been marked as a duplicate of this bug. ***
Comment 5 Brendan Zagaeski (Xamarin Support) 2016-01-29 22:24:47 UTC
## Status update: un-QA'd development build that includes the candidate fix

The candidate fix for this issue has been compiled into a development build for user testing:

http://download.xamarin.com/MonoTouch/Mac/monotouch-9.4.1.25.pkg


CAVEAT: This build has so far only passed a minimal set of basic QA sanity tests. It will be tested more thoroughly over the upcoming days before it is published to the Stable release channel.


If anyone tries this build and finds that it does _not_ solve the particular resource-related issue you are seeing on iOS, please file a new quick bug report [1] with some additional details about the particular issue you are seeing (and be sure to mention that you're using this candidate build). Thanks!

[1] https://bugzilla.xamarin.com/newbug?release=C6SR1
Comment 6 Neal 2016-01-29 22:44:44 UTC
The problem remains for me - NOT FIXED.
Comment 7 Brendan Zagaeski (Xamarin Support) 2016-01-29 22:52:00 UTC
Hmm. A bit "unluckily" the candidate build in Comment 5 does resolve the problem for the 1 test case the engineers currently have on file for this problem (the test case from non-public Bug 37837).

I will see if I can create a new minimized sample project based on that private sample to provide to customers for local testing. If the candidate build from Comment 5 solves the problem for that minimized project on all customer machines, then the engineers will be interested in additional test cases filed on separate bug reports.

(For Neal in particular, we can re-open your original Bug 37730 as its own bug report for further investigation. Let me get this sample project set up for you to try as a first little sanity check before that. Thanks!)
Comment 8 Brendan Zagaeski (Xamarin Support) 2016-01-30 00:42:16 UTC
Created attachment 14808 [details]
Minimal test case: Microsoft BCL Build NuGet + iOS Class Library

Here is a from-scratch test case that reproduces the precise behavior of the original non-public test case.




## Steps followed to replicate the problem

Attempt to build and run the attached test case in the "Debug|iPhoneSimulator" configuration.




## Verification status: Verified. This precise test case is fixed by the candidate build.


### BAD: Xamarin.iOS 9.4.1.23 (7f1cef9)

The application fails with the Objective-C exception mentioned in Comment 0:

Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: Could not find a storyboard named 'Main' in bundle NSBundle </Users/macuser/Library/Developer/CoreSimulator/Devices/FF7D5965-0E89-4E27-9BEC-FE33A8213F7D/data/Containers/Bundle/Application/E6567F2D-46DD-4B8E-A805-B204A0EA924D/UnifiedSingleViewIphone1.app>


### GOOD: Xamarin.iOS 9.4.1.25 (962a050)

The application launches without error on the simulator and displays the blank view controller.




## Steps followed to make the minimal test case

1. Create a new new single view iPhone template project.

2. Add a new template iOS class library to the solution.

3. Add a reference to the iOS class library in the app project.

4. Add the Microsoft BCL Build NuGet package to the app project.
Comment 10 Brendan Zagaeski (Xamarin Support) 2016-01-30 01:15:24 UTC
## Alternate test case

This is an additional test strategy that was used by the engineers to evaluate the problem and the candidate fix.




## Steps followed to replicate the problem

1. Create a new "iOS -> App -> Single View App" in Xamarin Studio on Mac.

2. Navigate to the `AppDelegate.cs` file and delete a semicolon from one of the lines to introduce a C# syntax error.

3. Attempt to build and run the app in the "Debug|iPhoneSimulator" configuration. (This step should fail due to the C# syntax error.)

4. Add back the missing semicolon in the `AppDelegate.cs` file.

5. Without cleaning the project, attempt to build and run the app again.




## Verification status: Verified. This precise test case is also fixed by the candidate build.


### BAD: Xamarin.iOS 9.4.1.23 (7f1cef9)

The application fails with the Objective-C exception mentioned in Comment 0:

Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: Could not find a storyboard named 'Main' in bundle NSBundle </Users/macuser/Library/Developer/CoreSimulator/Devices/FF7D5965-0E89-4E27-9BEC-FE33A8213F7D/data/Containers/Bundle/Application/E6567F2D-46DD-4B8E-A805-B204A0EA924D/UnifiedSingleViewIphone1.app>


### GOOD: Xamarin.iOS 9.4.1.25 (962a050)

The application launches without error on the simulator and displays the blank view controller.
Comment 11 Brendan Zagaeski (Xamarin Support) 2016-02-01 18:36:52 UTC
## Status update

The candidate build from Comment 5 has now been published as a hotfix to the Stable updater channel.




## Next steps for anyone seeing an additional cause of the problem

There has so far been one user report of another cause of the "Could not find a storyboard named." The initial investigation of that report indicates that the problem might be due to Xamarin Studio allowing an invalid setting in `Info.plist` rather than Xamarin.iOS failing to copy the storyboard into the `.app` bundle. Investigation of that issue is on-going.

If anyone finds an additional scenario where resources are missing after the update from Xamarin.iOS 9.4.0 to 9.4.1, please file a new quick bug report [1] with some additional details about the particular issue you are seeing (and be sure to mention that you've already updated to 9.4.1.25). Thanks!

[1] https://bugzilla.xamarin.com/newbug?release=C6SR1
Comment 12 Sebastien Pouliot 2016-02-01 19:50:12 UTC
*** Bug 38239 has been marked as a duplicate of this bug. ***
Comment 13 tuan_pham 2016-02-01 22:09:41 UTC
I have seen intermittent issues where the app icon is missing once installed on a device in both debug and ad-hoc deployment.  Does this issue also resolve missing app icons?
Comment 14 Brendan Zagaeski (Xamarin Support) 2016-02-01 22:12:04 UTC
@tuan, yes, the problem has been reported to affect app icons, and the candidate fix has been reported to resolve that issue as well.

If you see a different result please do file a new bug report as discussed in Comment 11. Thanks!

Note You need to log in before you can comment on or make changes to this bug.