I use Realm
in my project and so far it has been great ! I have migrated from swift 1.2
to Swift 2
and now I have an error when compiling my code on the device (not on simulator).
Here is the error :
dyld: Library not loaded: @rpath/libswiftSecurity.dylib Referenced from: /private/var/mobile/Containers/Bundle/Application/64E2D461-F95C-4E86-B3D3-5FAAA00AF77C/myPhotoCalendar.app/Frameworks/RealmSwift.framework/RealmSwift Reason: image not found
I really don't understand what it means. I tried some tricks but none of them worked so far. Any one could help me ?
You see this error, because you're using dynamic frameworks, but they are not copied into your app bundle. On the simulator, the dynamic linker can still find the built framework in the build products directory. But this is not present in the sandbox of the device, where your app is executed.
It seems like that's the case because the build phase "Embed Pods Frameworks" is missing from your project. Please make sure that CocoaPods is up to date. (gem update cocoapods
) You might then want to use your integration by pod deintegrate
and re-install from scratch again. (Alternatively, you could remove the aggregate target Pods_*.framework
from the linked libraries.) That should make sure, that all build phases are re-created by CocoaPods.
For references, you should have the build phases like seen below in your project's target:
The mentioned aggregate target framework is seen in the "Link Binary With Libraries" pane as Pods.framework
here. The name depends on whether or not you integrate multiple targets of your project and how they are named. So it could be also named Pods_YourApp.framework
.