I'm creating an iOS framework with Xcode6 and iOS8. When I link this with an iOS app and try running it on the device I get this error
dyld: Library not loaded: @rpath/FrameworkName.framework/FrameworkName
Referenced from: /private/var/mobile/Containers/Bundle/Application/0F2C2461-A68B-4ABA-A604-B88E6E9D1BB1/AppName.app/AppName
Reason: image not found
The 'Runpath Search Paths' build setting for the framework is set by default to
'@executable_path/Frameworks', '@loader_path/Frameworks'
I could not find any documentation related to this. This was something new introduced with Xcode6 and I would expect it to just work by simply including the framework into any app that needs it.
I also had same kind of problem where I was not able to launch the app & app was crashing with above message :
dyld: Library not loaded: @rpath/FrameworkName.framework/FrameworkName Referenced from: /private/var/mobile/Containers/Bundle/Application/xxxxxxxxxxxxxxxxxxx
Reason: image not found
Here is my approach that helped me to resolve this error:
In addition to the above solutions, recheck the paths of frameworks included in your application under
Build Settings --> Search Paths --> Framework Search Paths
To make this work
In the framework project settings change the install directory from '/Library/Frameworks' to '@executable_path/../Frameworks'
In the project that includes this framework, add a copy files phase and copy this framework to the 'Frameworks' folder. Once you do this ensure that this framework is listed under the 'Embedded Binaries' section.
I was getting this error on a library installed through CocoaPods. Cleaning the build folder (
cmd + option + shift + k
) and then doing a clean (cmd + shift + k
) was what ended up resolving this issue for me.If you are using Carthage
Run
carthage update
on terminalGo to Project Settings -> Build Phases -> Carthage Copy Frameworks
Add line in Inputs files:
$(SRCROOT)/Carthage/Build/iOS/YOURLIBRARY.framework
Add this line to Output files:
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/YOURLIBRARY.framework
I also had same kind of problem where I was not able to launch the app & app was crashing with above message :
dyld: Library not loaded: @rpath/FrameworkName.framework/FrameworkName Referenced from: /private/var/mobile/Containers/Bundle/Application/xxxxxxxxxxxxxxxxxxx
Reason: image not found
Here is my approach that helped me to resolve this error:
1.Please delete your app from device, Clean the build and and rebuild and run on the device.
2.If above steps does not help you, then please check for below settings :
From "TARGET">"Build Settings">"Runpath Search Paths" & then check for values "$(inherited)" & "@executable_path/Frameworks", Feel free to add incase they don't exist.
Build your app and run it on device