I've created a Cocoa Touch Framework to centralize my common Swift code and moved some things into it-- and now I'm using it in my other Swift project, in a workspace. At first the main project compiled, but upon startup I got this error:
dyld: Library not loaded: @rpath/libswiftCoreAudio.dylib Referenced from: /Users/username/Library/Developer/Xcode/DerivedData/AppName-guvhnmqtcqhmmndemyhztmwxbkjq/Build/Products/Debug-iphonesimulator/JBS.framework/JBS Reason: image not found
I've found that can fix it by turning on the option Embedded Content Contains Swift Code in the framework, but then I get a bunch of duplicate symbols in the log, like so:
objc[19237]: Class GGLBundleUtil is implemented in both /Users/username/Library/Developer/Xcode/DerivedData/AppName-guvhnmqtcqhmmndemyhztmwxbkjq/Build/Products/Debug-iphonesimulator/JBS.framework/JBS and /Users/username/Library/Developer/CoreSimulator/Devices/CCAD7FCA-BF5F-428A-8122-680B91300618/data/Containers/Bundle/Application/22DC1E4F-B631-450A-A157-A6ADA0126DE6/AppName.app/AppName. One of the two will be used. Which one is undefined.
I don't think I'm supposed to turn on the Embedded Content Contains Swift Code option in the framework, but I don't know why the framework can't find the Swift libraries. Anyone?
Edit:
When I try to run the app on the device, I get a similar but different error. It seems to be complaining that it can't see my framework:
dyld: Library not loaded: @rpath/JBS.framework/JBS Referenced from: /private/var/mobile/Containers/Bundle/Application/C7644037-E5A0-431E-A7DB-D3B124CDC677/AppName.app/AppName Reason: image not found