Bug 27959 - NSInternalInconsistencyException on Release only after upgrading Xamarin.IOS from 8.6.3 to 8.8.0
Summary: NSInternalInconsistencyException on Release only after upgrading Xamarin.IOS ...
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.9
Hardware: PC Windows
: --- normal
Target Milestone: 4.0.1 (C6SR1)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-03-12 10:50 UTC by Mark Swiatek
Modified: 2015-10-26 12:40 UTC (History)
9 users (show)

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


Attachments
Release VSV build log (17.49 KB, application/octet-stream)
2015-03-12 17:57 UTC, Mark Swiatek
Details
Screenshot of project structure in folders containing XIB files. (26.58 KB, image/png)
2015-03-19 15:17 UTC, Ruben Macias
Details
Screenshot of app bundle with same folder structure for NIB files (158.25 KB, image/png)
2015-03-19 15:18 UTC, Ruben Macias
Details
Screenshot of previous version of AppBundle (114.48 KB, image/png)
2015-03-19 15:26 UTC, Ruben Macias
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Mark Swiatek 2015-03-12 10:50:42 UTC
This only occurs in a Relase build. Dev builds work fine.

An unhandled exception occured.

2015-03-12 10:43:34.197 GVxRemoteControl[5686:47294] Unhandled managed exception: Objective-C exception thrown.  Name: NSInternalInconsistencyException Reason: Could not load NIB in bundle: 'NSBundle </Users/mark/Library/Developer/CoreSimulator/Devices/1A09244A-D292-4077-9F33-A1EF60181609/data/Containers/Bundle/Application/35A32B04-4695-40A3-93E9-7539DB112A38/GVxRemoteControl.app> (loaded)' with name 'ConnectionViewController' (Foundation.MonoTouchException)
  at ObjCRuntime.Runtime.ThrowNSException (IntPtr ns_exception) [0x00000] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.cs:156 
  at ObjCRuntime.Runtime.throw_ns_exception (IntPtr exc) [0x00000] in /Developer/MonoTouch/Source/maccore/runtime/Delegates.generated.cs:100 
  at (wrapper native-to-managed) ObjCRuntime.Runtime:throw_ns_exception (intptr)
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00
005] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:62 
  at UIKit.UIApplication.Main (System.String[] args) [0x00000] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:56 
  at GVxRemoteControl.Application.Main (System.String[] args) [0x00000] in <filename unknown>:0 
2015-03-12 10:43:34.197 GVxRemoteControl[5686:47294] critical: Stacktrace:

2015-03-12 10:43:34.197 GVxRemoteControl[5686:47294] critical: 
Native stacktrace:

2015-03-12 10:43:34.200 GVxRemoteControl[5686:47294] critical: 	0   GVxRemoteControl                    0x001adbf7 mono_handle_native_sigsegv + 311
2015-03-12 10:43:34.200 GVxRemoteControl[5686:47294] critical: 	1   GVxRemoteControl                    0x001b9aca sigabrt_signal_handler + 122
2015-03-12 10:43:34.200 GVxRemoteControl[5686:47294] critical: 	2   libsystem_platform.dylib            0x07c2d03b _sigtramp + 43
2015-03-12 10:43:34.201 GVxRemoteControl[5686:47294] critical: 	3   ???                                 0xffffffff 0x0 + 4294967295
2
015-03-12 10:43:34.201 GVxRemoteControl[5686:47294] critical: 	4   libsystem_sim_c.dylib               0x079b4a5a abort + 156
2015-03-12 10:43:34.201 GVxRemoteControl[5686:47294] critical: 	5   GVxRemoteControl                    0x0034333f xamarin_unhandled_exception_handler + 287
2015-03-12 10:43:34.201 GVxRemoteControl[5686:47294] critical: 	6   GVxRemoteControl                    0x001ae46b mono_invoke_unhandled_exception_hook + 91
2015-03-12 10:43:34.201 GVxRemoteControl[5686:47294] critical: 	7   GVxRemoteControl                    0x001ad45d mono_handle_exception_internal + 6685
2015-03-12 10:43:34.201 GVxRemoteControl[5686:47294] critical: 	8   GVxRemoteControl                    0x001aba39 mono_handle_exception + 41
2015-03-12 10:43:34.202 GVxRemoteControl[5686:47294] critical: 	9   GVxRemoteControl                    0x00145668 mono_x86_throw_exception + 136
2015-03-12 10:43:34.202 GVxRemoteControl[5686:47294] critical: 	10  ???                                 0x144cee57 0x0 + 340586071
2015-03-12 10:43:34.202 GVxRemoteControl[5686:47294] critical: 	11  ???                                 0x181469c8 0x0 + 403990984
2015-03-12 10:43:34.202 GVxRemoteControl[5686:47294] critical: 	12  ???                                 0x14772e6c 0x0 + 343354988
2015-03-12 10:43:34.202 GVxRemoteControl[5686:47294] critical: 	13  GVxRemoteControl                    0x00341bb0 xamarin_throw_ns_exception + 32
2015-03-12 10:43:34.202 GVxRemoteControl[56
86:47294] critical: 	14  GVxRemoteControl                    0x00343ad2 exception_handler + 178
2015-03-12 10:43:34.203 GVxRemoteControl[5686:47294] critical: 	15  CoreFoundation                      0x008038a0 __handleUncaughtException + 832
2015-03-12 10:43:34.203 GVxRemoteControl[5686:47294] critical: 	16  libobjc.A.dylib                     0x075cbd3d _ZL15_objc_terminatev + 100
2015-03-12 10:43:34.203 GVxRemoteControl[5686:47294] critical: 	17  libc++abi.dylib                     0x07c6acf0 _ZSt11__terminatePFvvE + 14
2015-03-12 10:43:34.203 GVxRemoteControl[5686:47294] critical: 	18  libc++abi.dylib                     0x07c6a70f _ZN10__cxxabiv1L22exception_cleanup_funcE19_Unwind_Reason_CodeP17_Unwind_Exception + 0
2015-03-12 10:43:34.203 GVxRemoteControl[5686:47294] critical: 	19  libobjc.A.dylib                     0x075cbbae _ZL26_objc_exception_destructorPv + 0
2015-03-12 10:43:34.203 GVxRemoteControl[5686:47294] critical: 	20  CoreFoundation                      0x0080338d +[NSException raise:format:] + 141
2015-03-12 10:43:34.203 GVxRemoteControl[5686:47294] critical: 	21  UIKit                               0x03481ae6 -[UINib instantiateWithOwner:options:] + 1003
2015-03-12 10:43:34.204 GVxRemoteControl[5686:47294] critical: 	22  UIKit                               0x032a32a4 -[UIViewController _loadViewFromNibNamed:bundle:] + 270
2015-03-12 10:43:34.204 GVxRemoteControl[5686:47294] critical: 	23  UIKit                               0x032a3a3b -[UIViewController loadView] + 295
2015-03-12 10:43:34.204 GVxRemoteCont
rol[5686:47294] critical: 	24  UIKit                               0x032a3c6f -[UIViewController loadViewIfRequired] + 78
2015-03-12 10:43:34.204 GVxRemoteControl[5686:47294] critical: 	25  UIKit                               0x032d9e2d -[UINavigationController _layoutViewController:] + 42
2015-03-12 10:43:34.204 GVxRemoteControl[5686:47294] critical: 	26  UIKit                               0x032da39c -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
2015-03-12 10:43:34.204 GVxRemoteControl[5686:47294] critical: 	27  UIKit                               0x032da4a0 -[UINavigationController _startTransition:fromViewController:toViewController:] + 90
2015-03-12 10:43:34.205 GVxRemoteControl[5686:47294] critical: 	28  UIKit                               0x032db43b -[UINavigationController _startDeferredTransitionIfNeeded:] + 669
2015-03-12 10:43:34.205 GVxRemoteControl[5686:47294] critical: 	29  UIKit                               0x032dc0b2 -[UINavigationController __viewWillLayoutSubviews] + 57
2015-03-12 10:43:34.205 GVxRemoteControl[5686:47294] critical: 	30  UIKit                               0x03450d1c -[UILayoutContainerView layoutSubviews] + 213
2015-03-12 10:43:34.205 GVxRemoteControl[5686:47294] critical: 	31  UIKit                               0x031d77b1 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 608
2015-03-12 10:43:34.206 GVxRemoteControl[5686:47294] critical: 	32  libobjc.A.dylib                     0x075e1771 -[NSObject performSelector:withObject:] + 70
2015-03-12 10:43:34.206 GVxRemoteControl[5686:47294] critical: 	33  QuartzCore                          0x098d31cf -[CALayer layoutSublayers] + 152
2015-03-12 10:43:34.206 GVxRemoteControl[5686:47294] critical: 	34  QuartzCore                          0x098c7055 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 397
2015-03-12 10:43:34.206 GVxRemoteControl[5686:47294] critical: 	35  QuartzCore                          0x098c6eb0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
2015-03-12 10:43:34.206 GVxRem
oteControl[5686:47294] critical: 	36  QuartzCore                          0x098251b6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 284
2015-03-12 10:43:34.206 GVxRemoteControl[5686:47294] critical: 	37  QuartzCore                          0x0982658a _ZN2CA11Transaction6commitEv + 392
2015-03-12 10:43:34.207 GVxRemoteControl[5686:47294] critical: 	38  QuartzCore                          0x098ec6d9 +[CATransaction flush] + 52
2015-03-12 10:43:34.207 GVxRemoteControl[5686:47294] critical: 	39  UIKit                               0x03149346 -[UIApplication _reportMainSceneUpdateFinished:] + 39
2015-03-12 10:43:34.207 GVxRemoteControl[5686:47294] critical: 	40  UIKit                               0x0314a2dc -[UIApplication _runWithMainScene:transitionContext:completion:] + 3217
2015-03-12 10:43:34.207 GVxRemoteControl[5686:47294] critical: 	41  UIKit                               0x03162e1e __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 59
2015-03-12 10:43:34.207 GVxRemoteControl[5686:47294] critical: 	42  UIKit                               0x031488da -[UIApplication workspaceDidEndTransac
tion:] + 155
2015-03-12 10:43:34.208 GVxRemoteControl[5686:47294] critical: 	43  FrontBoardServices                  0x0ad7590e __37-[FBSWorkspace clientEndTransaction:]_block_invoke_2 + 71
2015-03-12 10:43:34.208 GVxRemoteControl[5686:47294] critical: 	44  FrontBoardServices                  0x0ad7539f __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 54
2015-03-12 10:43:34.208 GVxRemoteControl[5686:47294] critical: 	45  FrontBoardServices                  0x0ad873a5 __31-[FBSSerialQueue performAsync:]_block_invoke + 26
2015-03-12 10:43:34.208 GVxRemoteControl[5686:47294] critical: 	46  CoreFoundation                      0x00726970 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
2015-03-12 10:43:34.208 GVxRemoteControl[5686:47294] critical: 	47  CoreFoundation                      0x0071c283 __CFRunLoopDoBlocks + 195
2015-03-12 10:43:34.209 GVxRemoteControl[5686:47294] critical: 	48  CoreFoundation                      0x0071c0db __CFRunLoopRun + 2715
2015-03-12 10:43:34.209 GVxRemoteControl[5686:47294] critical: 	49  CoreFoundation                      0x0071b37b CFRunLoopRunSpecific + 443
2015-03-12 10:43:34.209 GVxRemoteControl[5686:47294] critical: 	50  CoreFoundation                      0x0071b1ab CFRunLoopRunInMode + 123
2015-03-12 10:43:34.209 GVxRemoteControl[5686:47294] critical: 	51  UIKit                               0x03148292 -[UIApplication _run] + 571
2015-03-12 10:43:34.209 GVxRemoteControl[5686:47294] critical: 	52  UIKit                               0x0314b9b6 UIApplicationMain + 1526
2015-03-12 10:43:34.2
10 GVxRemoteControl[5686:47294] critical: 	53  ???                                 0x16ac04b0 0x0 + 380372144
2015-03-12 10:43:34.210 GVxRemoteControl[5686:47294] critical: 	54  ???                                 0x16ac02b0 0x0 + 380371632
2015-03-12 10:43:34.210 GVxRemoteControl[5686:47294] critical: 	55  ???                                 0x16ac0244 0x0 + 380371524
2015-03-12 10:43:34.210 GVxRemoteControl[5686:47294] critical: 	56  ???                                 0x16ac0084 0x0 + 380371076
2015-03-12 10:43:34.210 GVxRemoteControl[5686:47294] critical: 	57  ???                                 0x16ac01e2 0x0 + 380371426
2015-03-12 10:43:34.210 GVxRemoteControl[5686:47294] critical: 	58  GVxRemoteControl                    0x001dee55 mono_jit_runtime_invoke + 725
2015-03-12 10:43:34.211 GVxRemoteControl[5686:47294] critical: 	59  GVxRemoteControl                    0x0027c67f mono_runtime_invoke + 127
2015-03-12 10:43:34.211 GVxRemoteControl[5686:47294] critical: 	60  GVxRemoteControl                    0x002814b1 mono_runtime_exec_main + 401
2015-03-12 10:43:34.211 GVxRemoteControl[5686:47294] critical: 	61  GVxRemoteControl                    0x0028125a mono_runtime_run_main + 682
2015-03-12 10:43:34.211 GVxRemoteControl[5686:47294] critical: 	62  GVxRemoteControl                    0x0013d4dd mono_jit_exec + 93
2015-03-12 10:43:34.211 GVxRemoteControl[5686:47294] critical: 	63  GVxRemoteControl                    0x0033f8a4 xamarin_main + 2500
2015-03-12 10:43:34.212 GVxRemoteControl[5686:47294
] critical: 	64  GVxRemoteControl                    0x00355e95 main + 117
2015-03-12 10:43:34.212 GVxRemoteControl[5686:47294] critical: 	65  libdyld.dylib                       0x0790aac9 start + 1
2015-03-12 10:43:34.212 GVxRemoteControl[5686:47294] critical: 
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 1 Sebastien Pouliot 2015-03-12 11:53:53 UTC
> NSInternalInconsistencyException Reason: Could not load NIB in bundle:

It sounds like a file is missing from the bundle, but that generally is identical across build configuration (debug/release).

Can you either share that project with us ?

If not then can you (a) set the XS build logs to diagnostics, (b) add "-v -v -v -v" to the additional touch arguments, (c) rebuild the release configuration and attach the build logs and (d) rebuild the debug (working) configuration and attach the build logs.
Comment 2 Mark Swiatek 2015-03-12 14:13:12 UTC
I can not reproduce the problem in Xamarin Studio. It only occurs when I run in Visual Studio.
Comment 3 Mark Swiatek 2015-03-12 17:55:54 UTC
I did a fresh checkout and the problem is now occurring in both DEBUG and RELEASE mode in Visual Studio. Just to be sure I did the same on the Mac and do not see the issue. 

I don't see a way to set the build logs to diagnostic in Visual Studio. I added the -v -v -v -v arguments and have attached the build log.
Comment 4 Mark Swiatek 2015-03-12 17:57:25 UTC
Created attachment 10314 [details]
Release VSV build log
Comment 6 Adrian Alonso 2015-03-18 15:46:58 UTC
@Mark I'm not able to reproduce the issue so far. It would be great if you could provide a simple repro. Or ideally a source project that generates the error.
Comment 7 Ruben Macias 2015-03-19 15:17:50 UTC
Created attachment 10417 [details]
Screenshot of project structure in folders containing XIB files.
Comment 8 Ruben Macias 2015-03-19 15:18:32 UTC
Created attachment 10418 [details]
Screenshot of app bundle with same folder structure for NIB files
Comment 9 Ruben Macias 2015-03-19 15:19:23 UTC
I can confirm this with Version 8.8 of the Visual Studio extension.  Here's what I see.  In my project, I have XIB files representing my UI.  I organize them through the folders and I have no XIB files in my root project directory (See Screenshot).  When run on the simulator, I get the exact same error message as Mark.  In examining the app bundle located in the simulator directory, there are no NIB files in the root directory (I'm sure prior to v 8.8 I would see NIB files here).  They are now organized in the same folder structure as in my iOS project (see screenshot).  As a quick test, I copied over the NIB files to the root of the App bundle and the app runs as expected.  I think something may have changed.
Comment 10 Ruben Macias 2015-03-19 15:26:28 UTC
Created attachment 10421 [details]
Screenshot of previous version of AppBundle

Added a screenshot of my app bundle showing that with the previous version of the Xamarin VS Extension, all NIB files were copied to the root folder of the app bundle.  In Version 8.8, this is no longer the case, and thus breaking our projects.
Comment 11 Ruben Macias 2015-03-19 15:37:36 UTC
Sorry for the version info mix up in my previous comments.  Something has changed from Xamarin v3.9.347 to v3.9.483 in where the NIBs are not copied into the root directory of the app bundle.
Comment 14 Dominic N [MSFT] 2015-09-28 11:52:07 UTC
Sample project attached.
Comment 16 Enzo Heredia 2015-10-26 12:40:14 UTC
Im able to build succesfully in Release in build 4.0.0.1625