Crash reported on App store app with the exception:
`NSInternalInconsistencyException Could not load NIB in bundle...`
This crash is being reported since the last two months on iOS 10 devices and for multiple xib files.
Details of one such instance:
Fatal Exception: NSInternalInconsistencyException
Could not load NIB in bundle: 'NSBundle </var/containers/Bundle/Application/XXX/MyApp.app> (loaded)' with name 'VideoView'`
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x18d7551b8 __exceptionPreprocess
1 libobjc.A.dylib 0x18c18c55c objc_exception_throw
2 CoreFoundation 0x18d755100 -[NSException initWithCoder:]
3 UIKit 0x193b04fcc -[UINib instantiateWithOwner:options:]
4 UIKit 0x193965e14 -[UIViewController _loadViewFromNibNamed:bundle:]
5 UIKit 0x193737980 -[UIViewController loadView]
6 UIKit 0x1936035bc -[UIViewController loadViewIfRequired]
7 UIKit 0x1936034ec -[UIViewController view]
8 MyApp 0x100135580 -[VideoEventController addMediaPlaybackViewForChannel:andProgram:ofType:] (VideoEventController.m:113)
Code used to init view controller is:
self.videoViewCtrl = [[VideoViewController alloc] initWithNibName:@"VideoView" bundle:nil];
[mediaView addSubview:self.videoViewCtrl.view]; //Crash trace points to this line in code
Copy Bundle Resources
Target Membership
Related to Group
Code uses AutoLayout but not the size classes. Project has separate xibs for iPad and iPhone adhering to naming conventions.
Did anyone face the same issue? What could be the reason for failure to load NIB?
After months of investigation finally we figured out what was causing the issue.
We have one static library (in-house) integrated with app for analytics purposes. We found that, this library is leaking the file descriptors acquired for i/o operations.
What happens is, as soon as app runs out of the i/o resources, the very next resource request fails. In our case its the xib initialisation. This error was causing the app to crash with exception:
`NSInternalInconsistencyException Could not load NIB in bundle.`
Below references actually helped us to draw this conclusion.
How we zeroed on library is:
We have reported our observations to library dev team and awaiting the response.