dyld: Library not loaded: @rpath/libswiftCore.dylib dyld: Library not loaded: @rpath/libswiftCore.dylib xcode xcode

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

For me none of the previous solutions worked. We discovered that there is an "Always Embed Swift Standard Libraries" flag in the Build Settings that needs to be set to YES. It was NO by default!

Build Settings > Always Embed Swift Standard Libraries

After setting this, clean the project before building again.

For keen readers some explanationThe most important part is:

set the Embedded Content Contains Swift Code (EMBEDDED_CONTENT_CONTAINS_SWIFT) build setting to YES in your app as shown in Figure 2. This build setting, which specifies whether a target's product has embedded content with Swift code, tells Xcode to embed Swift standard libraries in your app when set to YES.

enter image description here

The flag was formerly called Embedded Content Contains Swift Code

Surprisingly enough, all i did was "Clean" my project (shift+cmd+K) and it worked. Did seem to be related to the certificate though.

I started getting this error when I removed:


from Runpath Search Paths in my build settings. Replacing it fixed everything up again (thank goodness for source control!)

I don't know how it got there, but it appears to be needed for a binary to find its embedded Swift runtime.