Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedded Content Contains Swift Code with Xcode 8 Beta

I am developing a command line macOS application(with Objective-C) which uses other 3rd party Swift libraries. I am retrieving an error says "dyld: Library not loaded: @rpath/libswiftAppKit.dylib"

Previous answers recommend to set "Embedded Content Contains Swift Code" flag to true. However, this flag is missing with Xcode 8 beta.

I have tried "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", which i believe a new flag for Xcode 8. It doesn't work either :(

Is anyone tried to compile and execute a command line application with Xcode 8 beta that is; - developed using Objective-C - having 3rd party swift library dependencies

Update:

I ended up copying everything under "/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx" into the folder where the executable stands. Not a perfect solution but it works.

like image 616
Oguz Demir Avatar asked Aug 05 '16 15:08

Oguz Demir


1 Answers

Check this mentioned in Xcode 8 beta 2 Release Notes:

The new build setting ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES replaces the use of EMBEDDED_CONTENT_CONTAINS_SWIFT. This setting indicates that Xcode should always embed Swift standard libraries in a target for which it has been set, whether or not the target contains Swift code. A typical scenario for using this setting is when a target directly uses or embeds another product which contains Swift code.

Note: EMBEDDED_CONTENT_CONTAINS_SWIFT has been deprecated. (26158130).

like image 199
Jorge Irún Avatar answered Oct 23 '22 12:10

Jorge Irún