OSX Command Line Tool with Swift Cocoa Library, Library not loaded

Originator:bouke
Number:rdar://20094031 Date Originated:2015-03-09
Status:Open Resolved:
Product:Xcode Product Version:Version 6.3 (6D532l)
Classification: Reproducible:
 
Summary:
The following error is thrown when trying to run my target:

    dyld: Library not loaded: @rpath/libswiftCore.dylib
      Referenced from: x/Xcode/DerivedData/x/Build/Products/Debug/PriorityQueue.framework/Versions/A/PriorityQueue
      Reason: image not found

My target is a Command Line Tool (OSX) written in Swift. I'm using a Cocoa Framework (PriorityQueue) written in Swift. When I set `EMBEDDED_CONTENT_CONTAINS_SWIFT` to yes on the **Framework**, the target runs with the following warnings:

    objc[99144]: Class _TtC10Foundation15NSSimpleCString is implemented in both x/PriorityQueue.framework/Versions/A/Frameworks/libswiftFoundation.dylib and x/MyTargetName. One of the two will be used. Which one is undefined.
    (...)

And then crashes with:

    MyTargetName[99144:2157492] *** NSForwarding: warning: object 0x1014346a0 of class 'Swift._NSContiguousString' does not implement methodSignatureForSelector: -- trouble ahead
    Unrecognized selector -[Swift._NSContiguousString fileSystemRepresentation]

Steps to Reproduce:
1. Create Xcode Cocoa Framework with Swift code
2. Use this framework inside an Swift Command Line Tool

Expected Results:
3. The tool runs successfully

Actual Results:
3. The tool crashes with said error message

Version:
Version 6.3 (6D532l)

Notes:


Configuration:


Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!