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

Leave a Comment