Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminating app due to uncaught exception #6

Open
willm132 opened this issue Jun 14, 2021 · 2 comments
Open

Terminating app due to uncaught exception #6

willm132 opened this issue Jun 14, 2021 · 2 comments

Comments

@willm132
Copy link

willm132 commented Jun 14, 2021

*** 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

@charlymr
Copy link

@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

@willm132
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants