Error loading application "Library not loaded"

I created a Mac application that uses RMSharedPreferences . When you open the application, it immediately crashes, and I get the following error:

Dyld Error Message:
  Library not loaded: @rpath/RMSharedPreferences.framework/Versions/A/RMSharedPreferences
  Referenced from: /Users/USER/Desktop/MyApp.app/Contents/MacOS/MyApp
  Reason: image not found

It seems that he cannot find the structure. I tried to add the phase of the copy files to the target, which should copy the framework and when viewing the contents of the application in Finder, it seems that it was copied correctly.

Does anyone know what might cause this error?

EDIT : setting the framework to optional makes the application launch without any errors , but the application does not work fully. Any calls related to RMSharedPreferences will be ignored.

Copy framework.Contents of app.

+5
source share
2

, . " ". - :

@executable_path

, :

@executable_path/../Frameworks/

( , ), :

install_name_tool -id @executable_path/../Frameworks/<framework_name> <your_framework>

.

, @loader_path @executable_path.

+10

@rpath - , .

- " " Xcode.

script, .

, " "

@executable_path/../Frameworks

@loader_path/../Frameworks

.

+4

All Articles