DocumentScanner icon indicating copy to clipboard operation
DocumentScanner copied to clipboard

Terminating app due to uncaught exception

Open willm132 opened this issue 3 years ago • 2 comments

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle app.app> (loaded)' with name 'ScannerView'' terminating with uncaught exception of type NSException

Will add that I am using SPM

willm132 avatar Jun 14 '21 15:06 willm132

@willm132 hello, yes this is a very common problem, with NSBundle especially if you use SPM. What happen is that NSBundle is looking for the nib in the App Bundle, but probably the NIB is in your SPM bundle., correct?

An easy way to fix this will be to update the code with: https://developer.apple.com/documentation/foundation/nsbundle/1417717-bundleforclass Where you will use a class present in your SPM. This way, when you initiate NSBundle it will search for it in the Package bundle rather than the main app bundle.

Please let me know if it works

charlymr avatar Jun 14 '21 19:06 charlymr

I ended up just removing SPM and using Cocoapods instead and it's working now. Thanks!

willm132 avatar Jun 14 '21 19:06 willm132