ios - swiftyjson - library not loaded rpath lottie framework lottie
iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta (14)
For iOS greater than or equal to 8
Under the target's General tab, in the Embedded Binaries section add the framework. This will copy the framework into the compiled so that it can be linked to at runtime.
Why is this happening? : because the framework you are linking to is compiled as a dynamically linked framework and thus is linked to at runtime.
Note : Embedding custom frameworks is only supported in iOS > 8 and thus and alternative solution that works on older versions of iOS follows.
For iOS less than 8
If you have influence on this framework (have access to the source code / build process) you may change this framework to be statically linked rather than dynamically linked. This will cause the code to be include in your compiled app rather than linked to at runtime and thus the framework will not have to be embedded.
How : Under the framework's Build Setting tab, in the Linking section change the Mach-O Type to Static Library. You should now not need to include the framework under embedded binaries.
Including Assets : To include things such as images, audio, or xib/nib files I recommend creating a bundle (essentially a directory, more info here bit.ly/ios_bundle) and then load the assets from the bundle using NSBundle.
This crash has been a blocking issue, basically I used following steps to reproduce the issue:
- Create a Cocoa Touch Framework project
- Add a swift file and a class Dog
- Build framework for device
- Create a Single View application in Swift
- Import framework into app project
- Instantiate swift class from the framework in ViewController
- Build and run app on device
The app immediate crashed upon launching, here is console log:
dyld: Library not loaded: @rpath/FrameworkTest03.framework/FrameworkTest03 Referenced from: /var/mobile/Applications/FA6BAAC8-1AAD-49B4-8326-F30F66458CB6/FrameworkTest03App.app/FrameworkTest03App Reason: image not found
I have tried to build on iOS 7.1 and 8.0 devices, they both have the same crash. However I can build app and run on simulator fine. Also I am aware that I can change the framework to from Required to Optional in Link Binary With Libraries, but it did not completely resolve the problem, the app crashed when I create an instance of Dog. The behavior is different on device and simulator, I suspect that we can't distribute framework for device using beta version of Xcode. Can anyone shed light on this?
- Go to file in xcode -> Workspace settings
- Click the arrow next to which appears /Users/apple/Library/Developer/Xcode/DerivedData
- Select the Derived data and move it to Trash.
- Quite the xcode and reopen it.
- Clean the project and run again.
Above steps resolved my issuses.
After trying all the methods available on internet and my own trial and error tricks 100 times. Finally I was able to solve it. – Apeksha Sahu 6 mins ago
Goto iTunes in Mac --> accounts-->Authorize this computer – Apeksha Sahu 5 mins ago
second step.... Goto developer in settings in iPad and iPhone and reindex with identifiers and clear trust computers everything. It worked for me........ ....... After reinstalling Mac OSHigh seria 10.13.15 version from Mac OS seirra beta latest version, to reinstalling Xcode latest version, after updating all certificates. etc etc etc... as many methods as you can think I did. –
I got same kind of issue in iOS 9.x version
ISSUE IS: App crashes as soon as I open the app with below error.
dyld: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/UserNotifications Referenced from: /var/containers/Bundle/Application/######/TestApp.app/TestApp Reason: image not found
I have resolved this issue by changing
Linked Frameworks and Libraries for
I had to (on top of what mentioned here) add the following line to Runpath Search Paths under Build Settings tab:
I received this same error while attempting to manually add my created framework into my project. Just dragging the framework into your project isn't going to be good enough. That is like being in the same ballpark but not being able to find your kids. It took me some trial and error to get it to work properly but following these steps did it for me.
1) Create your framework
- Develop your framework.
- Once your development is complete,
Bbuild your framework and ensure you receive "Build Succeeded".
2) Access your framework
- Once your framework project successfully builds it will then be ready for you to access in your
Productsfolder in your project.
- Right click on your
.frameworkand select "Show in Finder".
3) Place framework in your project
- Drag and drop the
.frameworkfrom your Finder window to your app project's "Framework" folder.
4) Configure app project for framework
- Select the top level in your project
- Choose your target
- Go to "Build Phases", then "Link Binary with Libraries", and ensure that your framework is included with optional selected.
- Still in "Build Phases", go to the upper left and select the
+button. In the drop down choose "New Copy Files Phase".
- Scroll down to the new "Copy Files" section and ensure that you set
Destinationto "Frameworks". Leave the subpath empty. Then click the
+button at the bottom left.
- You will be presented with your project hierarchy. Scroll down to the "Frameworks" folder that you added the framework to in step 3, or search for it in the search bar at the top. Select your framework and click "Add".
- Ensure that your framework is included with "Code Sign On Copy" selected.
5) Clean, then run your project
If you are using a third-party framework, and using Cocoapods as your dependency manager, try doing a
pod install to refresh your pods.
This crash was occurring on a third-party library I was using, so glad the above solution worked for me, hope it works for you!
In case anyone is still experiencing this issue, despite following all the steps outlined in the many other answers, you may need to revoke and recreate your code signing certificate, as per the following:
In the target's General tab, there is an Embedded Binaries field. When you add the framework there the crash is resolved.
Reference is here on Apple Developer Forums.
The same thing was when I've created a new Configuration and Build Scheme.
So the solution for me was to run
for this newly created Configuration.
You need to add the framework to a new Copy Files Build Phase to ensure that the framework is copied into the application bundle at runtime..
See How to add a 'Copy Files build phase' to my Target for more information.