Swift dylibs not copied to my bundle

I have a Swift 3 based project (started under Xcode 8b1). It's been working fine under betas 1 and 2, but under 3 it's crashing at launch:


dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib


Looking at the bundle, I see the /Frameworks folder is empty. Why won't Xcode copy the default Swift dlybs to my app anymore? I've not changed any settings since b2 (where they were all copied fine.


Ben

Replies

What worked for me was benjohnde 's solution in his comment below the gist. I am using Carthage to add the Fuzi html parser framework to a project. Adding these commands to the Carthage build script (manually copying the the libswiftCore files to the project) is what worked for me.


As linking to gists doesn't seem to be allowed, I'm copy/ pasting the comment:


You can also use the copy-frameworks cmd by Carthage and just run before the Carthage script the following:

$TOOLCHAIN_DIR/usr/bin/swift-stdlib-tool \ --copy --verbose --sign ${EXPANDED_CODE_SIGN_IDENTITY} \ --scan-executable ${TARGET_BUILD_DIR}/${EXECUTABLE_PATH} \ --scan-folder ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH} \ --scan-folder ${TARGET_BUILD_DIR}/${PLUGINS_FOLDER_PATH} \ --platform ${PLATFORM_NAME} \ --toolchain $TOOLCHAIN_DIR \ --destination ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH} \ --strip-bitcode --resource-destination ${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME} \ --resource-library libswiftRemoteMirror.dylib

This then copies only the missing swift framework files needed to actually run the app. For me, this works perfectly!

Been trying this script in the copy-carthage script phase. It's copying the swift libs, but when the app runs there is some sort of incompatibility:


dyld: Symbol not found: __TMps11CVarArgType
  Referenced from: /Users/derekclarkson/Library/Developer
   /CoreSimulator/Devices/277C19C2-718E-4CC2-9873-BB6E4C3A46E3/data/Containers/Bundle
   /Application/833A6F44-D2D3-4523-873C-99E8DF51D646/crux-iOS.app/Frameworks/SocketIOClientSwift.framework/SocketIOClientSwift
  Expected in: /Users/derekclarkson/Library/Developer
    /CoreSimulator/Devices/277C19C2-718E-4CC2-9873-BB6E4C3A46E3/data/Containers/Bundle
    /Application/833A6F44-D2D3-4523-873C-99E8DF51D646/crux-iOS.app/Frameworks/libswiftCore.dylib
 in /Users/derekclarkson/Library/Developer/CoreSimulator/Devices/277C19C2-718E-4CC2-9873-BB6E4C3A46E3
    /data/Containers/Bundle/Application/833A6F44-D2D3-4523-873C-99E8DF51D646/crux-iOS.app
    /Frameworks/SocketIOClientSwift.framework/SocketIOClientSwift