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

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 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


For me none of the previous solutions worked. We discovered that there is a 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!


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.

Tags:

Swift

Dyld