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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With