Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"image not found" Error while using Custom FrameWork

I created my own framework for one of my cocoa application. I added that framework to my project and called a method from that framework. When I tried to run my application it crashed:

Crash Log:

dyld: Library not loaded: @rpath/MMP.framework/Versions/A/MMP
  Referenced from: /Users/Midhun/Library/Developer/Xcode/DerivedData/MMPTest-ccvjtgedqkcftchapjehhwjbaqdq/Build/Products/Debug/MMPTest.app/Contents/MacOS/MMPTest
  Reason: image not found

What I have done:

FrameWork:

  • I added my header file in public section

Public Header

  • I added the paths of Deployment and Linking like:

Paths

  • I build the project and I got my framework ready (Pretty cool till here).

Project:

  • I added that framework to FrameWorks folder under my Project's root directory.
  • I added the framework under Link Binary With Libraries Section
  • I changed the path of Linking like: Changed Path

Platform Details:

Xcode: 4.6.2
OS X : 10.8

What I have tried (After the crash)

  • When I get this issue, I checked with otool. It shows the paths like:

otool

  • I followed this link: A Visual Guide to Creating an Embeddable Framework for Mac OSX

But I couldn't fix the issue, yet. Please help me, thanks in advance.

like image 409
Midhun MP Avatar asked Nov 20 '13 10:11

Midhun MP


1 Answers

Set framework installation directory to @executable_path/../Frameworks

enter image description here

Now add copy files in your build phase, set destination to Frameworks. click on your target, then on Editor (menu bar) --> Add build phase --> Add Copy Files Build Phase

enter image description here

enter image description here

like image 200
Parag Bafna Avatar answered Sep 29 '22 12:09

Parag Bafna