Recently I ran into an error submitting eatkeep to the Mac App Store. As it will eventually be a universal app (ios, mac) I created a project that generates a framework (mac) and a static library (ios).
The problem came upon review and receiving the following error from a stacktrace from the reviewer:
Dyld Error Message: Library not loaded: /Library/Frameworks/[framework-name].framework/Versions/A/[framework-name] Referenced from: /[path]/[app-name].app/Contents/MacOS/[app-name] Reason: image not found
The problem was due to the Installation Directory not being set correctly. You can find this setting under the Frameworks Build Settings.
What I had was:
and what I needed was:
The following has been extracted from the links mentioned above and should be enough to help fix this issue.
Building The Framework
- Add a target to create a Cocoa Framework
- Within that targets ‘Build Settings’ configure the ‘Installation Directory’ to ‘@executable_path/../Frameworks’
- Build library, and access the .framework from the archive or products directory
Including The Framework
- Drag the created .framework file into the Xcode Project, be sure to tick ‘Copy Files to Directory’
- In the containing applications target, add a new ‘Copy File Build Phase’
- Set the ‘Destination’ to ‘Frameworks’
- Drag in the created .framework