Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dyld: Library not loaded: @rpath with iOS8

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.

like image 956
ArdenDev Avatar asked Jan 30 '15 20:01

ArdenDev


1 Answers

To make this work

  1. In the framework project settings change the install directory from '/Library/Frameworks' to '@executable_path/../Frameworks'

  2. 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.

like image 152
ArdenDev Avatar answered Oct 26 '22 02:10

ArdenDev