dyld: Library not loaded: @rpath with iOS8

ArdenDev picture ArdenDev · Jan 30, 2015 · Viewed 52.5k times · Source

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.

Answer

ArdenDev picture ArdenDev · Feb 9, 2015

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.