Reputation: 1351
I have been plagued by a bug for hours. I am building a framework using Alamofire and am testing it in an iOS project. Whenever I run the project, I get this error:
dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire Referenced from: /Users/theodorestrauss/Library/Developer/Xcode/DerivedData/TGClient-ecnnvvvxipoufihfghkpxlfccyoc/Build/Products/Debug-iphonesimulator/TGClient.framework/TGClient Reason: image not found
I have scoured the web looking at GitHub issues, Stack articles, and more. I've cleaned, deleted Derived Data, added and deleted frameworks from embedded binaries, etc.
For anyone out there, this is not a duplicate. All other questions and answers are outdated.
If anyone can help, I'd immensely appreciate it. Thanks so much in advance. Cheers,
Theo
Upvotes: 6
Views: 9335
Reputation: 740
I solve it by unchecking run script only when installing
in build phases menu
Upvotes: 2
Reputation: 7708
I was getting this error while using Alamofire 4.5 + carthage
, I added the framework as Linked Libraries in the build phase, the app was crashing on start. In XCode 9.1
I couldn't find the option of Embedded framework, so I added a Run Script to copy framework from Carthage and it started working.
So basically this
/usr/local/bin/carthage copy-frameworks
$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework
Upvotes: 1
Reputation: 5303
This is what I do when I have this problem (and it really works!):
Remove Alamofire framework from target/embedded libraries and target/linked frameworks and libraries by highlighting it and clicking the minus sign. (click on your project name in the upper left corner if you don't see these areas in the center of your screen).
Perform a product clean (Shift-Cmd-K).
In Embedded Binaries section, click on the + sign. Add Alamofire. (or drag the Alamofire icon from the left column into this section and drop it there)
Xcode should fix everything, and it should now load onto the device properly.
Upvotes: 1
Reputation: 4074
Make sure your build settings > Runpath search paths have be
• @executable_path/Frameworks
• $(inherited)
Also in your framework search path below entry is there
"$PODS_CONFIGURATION_BUILD_DIR/Alamofire"
Upvotes: 2
Reputation: 4174
Can you please clear derived data once and build the project again.
Here is how to clear derived data. Open the terminal and simply hit this command.
rm -rf ~/Library/Developer/Xcode/DerivedData
Upvotes: 1