Reputation: 3820
I'm using SQLite for the extension in an app. Everything work fine in Simulator, but error has occurred when i run the app in my device.
dyld: Library not loaded: @rpath/SQLite.framework/SQLite Referenced from: /private/var/mobile/Containers/Bundle/Application/898AED60-6F5F-482C-83FC-A55655599429/*.app/PlugIns/*.appex/* Reason: image not found
I have to add framework to "Copy files" section in the extension. Trouble solved.
But when i run the app on my device, i have to uncheck on option "Copy only when installing" and when i run my app on simulator, i have to check on it. If i didn't new error will show:
error: make directory /Users/*/Library/Developer/Xcode/DerivedData/*-dlklrcpbpykobgbkaophrsrhssxr/Build/Products/Debug-iphonesimulator/*.appex/Frameworks/SQLite.framework: File exists
How to solve it. And if i archive and upload app to appstore, whats about this option, how to get it run with simulator and device also?
Upvotes: 2
Views: 2256
Reputation: 3820
I've gotten rid of this error by adding framework to the Copy files
section in extension, but also remove the framework in Linked framework and Libraries
to avoid this error.
Upvotes: 3
Reputation: 252
In your target, select General tab. In Embedded Binaries section add your SQL.framework. This is for dynamic libs. Clean an run on simulator and device.
If does not works, back to target, Build Setting tab. In your copy files phase, uncheck Copy only when installing, check Code Sign On Copy, and select Destination like Frameworks
This allow archive ipa with no problems.
Upvotes: 5