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.
Issue resolved using this answer. According to @vladof81:
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.
For me it was because of the SSL issue, I had set my developer, distribution certificates on my Mac(Keychain) to 'Always Trust' for one of my other project. I had to change them back to 'Use System Defaults'. it was working for me then!!
Check if you can find framework in context under :
Build Phases > Embed Frameworks >
If not just add that framework in "Embed Frameworks" after adding that framework in your project directory's "Frameworks" section.
Made the library which shows not loaded changed from required to optional in Linked binaries and frameworks. It is working perfectly now
I installed third party libraries using Cocoapods. Got the same error, tried everything but finally realised I havent had use_frameworks! in my pod file.
So removed the currently installed library, added use_frameworks! line in pod file, reinstalled the libraries and all worked for me.
When non of those solution works:
.framework
file paths are added inBuild Settings -> Framework Search Paths
. You can keep all framework files somewhere inApp/libs/
and add this folder and enable recursively..a
files paths are added inBuild Settings -> Library Search Paths
.