Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dyld: Library not loaded: @rpath/libswift_stdlib_core.dylib

Tags:

swift

dyld

For me none of the previous solutions worked. We discovered that there is an flag ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES (in earlier versions: "Embedded Content Contains Swift Code") in the Build Settings that needs to be set to YES. It was NO by default!


This error can occur if something went wrong during the conversion of an Objective-C project to start using Swift. The issue is that the Linker build settings never got configured properly, so you'll have to do it by hand. Look for the Runpath Search Paths build setting and set it to:

$(inherited) @executable_path/Frameworks

enter image description here

EDIT: I should also add that there has been recent spate of these errors caused by something else entirely - Apple made a change in Swift itself, starting in perhaps Xcode 6.1 or 6.1.1. The only solution seems to be to quit Xcode, destroy your certificates in Keychain Access, go to the Member Center and delete all certificates and profiles (except the profiles for apps in the Store - you can't delete them), and then start the entire certificate request process from scratch.


I'm not really sure why this question is being downvoted, I had this problem as well when I first tried to use Swift with an existing project. An Xcode restart also fixed this for me.


I searched long on this issue. There are several reasons causes this issue.

If you are facing when you and Swift code/library in an Objectice C project you should try Solution 1-2-3

If you are facing this issue with a new a Swift project Solution 4 will fit you best.

Solution 1:

Restart Xcode, then computer and iPhone

Solution 2:

Go to project build settings and set Always Embed Swift Standard Libraries (previously Embedded Content Contains Swift Code) flag to YES

Solution 3:

Go to project build settings and add @executable_path/Frameworks to Runpath Search Paths option

Solution 4:

If none of above works, this should. Apple seems to be ninja patched certificates as mentioned in AirSign's post

At InHouse certificates

Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, O=Company Name, C=FR

they added a new field named OU

Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, OU=269J2W3P2L, O=Company Name, C=FR

so you should just recreate certificate and provision


In my case I was trying to import a custom framework and was getting the similar error. Turns out I had to import the framework in the Embedded Binaries rather than in to the Linked Frameworks and Libraries.

Embedded Binaries are under Projects Settings -> -> General


For developers who have had this issue with a Adhoc/Enterprise distribution builds,

Create the production certificate from dev portal and then regenerate the distribution profile. Download and install both of them on your Mac. Ensure you selected the right profile in your Xcode build settings and rebuild your app.

Source: https://devforums.apple.com/message/1022908#1022908


Solution 5:

In my case, all solutions mentioned in the answer of accfews were very helpful but none has worked. I solved my problem by adding my swift library in the section "Embedded Binaries" in the "General" section of my Project's target. Perhaps is this due to the fact that I have included my swift framework in my workspace? Whatever it compiles now! Get ready Swift, I'm here!