Error building with Xcode 11 Swift 5.1

I have a framework project built in Xcode 10, Swift 5 and targeting iOS 11. I've opened the project up in Xcode 11 BETA 4 and executed a build via the command line. I set the Xcode Location setting to Command Line Tools: Xcode 11.0 (11M374r). Here is my xcodebuild arguments:


xcodebuild -configuration Release -target MySDKKit -sdk iphoneos -scheme "My SDK Build" -derivedDataPath ./build clean build

In the project itself, I have the following:
User-Defined

BITCODE_GENERATION_MODE
Debug marker
Release bitcode
The rest of the project build settings are pretty much out of the box. The Valid Architectures arm64 arm64e armv7 armv7s
So here is the error:

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)


** BUILD FAILED **


The following build commands failed:

Ld /Users/craig/Documents/Xcode/sdk-ios/MySDKKit/build/Build/Products/Release-iphoneos/MySDKKit.framework/MySDKKit normal arm64

If I remove the Bitcode setting the project builds fine, but I can;t make an archive in an app project. If I enable Bitcode and target iOS 13, the build will also build without issue.


Any ideas?

Many thanks

Craig

Accepted Reply

I think I've found the underlying issue. I did a build in Xcode 11 (BETA 4) and noticed these warnings:


Showing All Messages

Could not find or use auto-linked library 'swiftFoundation'

Could not find or use auto-linked library 'swiftsimd'

Could not find or use auto-linked library 'swiftMetal'

Could not find or use auto-linked library 'swiftDarwin'

Could not find or use auto-linked library 'swiftCoreFoundation'

Could not find or use auto-linked library 'swiftos'

Could not find or use auto-linked library 'swiftQuartzCore'

Could not find or use auto-linked library 'swiftCore'

Could not find or use auto-linked library 'swiftCoreGraphics'

Could not find or use auto-linked library 'swiftObjectiveC'

Could not find or use auto-linked library 'swiftDispatch'

Could not find or use auto-linked library 'swiftAVFoundation'

Could not find or use auto-linked library 'swiftCoreMedia'

Could not find or use auto-linked library 'swiftCoreImage'

Could not find or use auto-linked library 'swiftCoreAudio'

Could not find or use auto-linked library 'swiftUIKit'


A search in the forums and I came across this post: https://forums.developer.apple.com/thread/120074


After doing the suggest comment add LD_VERIFY_BITCODE = NO to user defined build settings. I no longer got the error of my original post, the warnings disappeared and was able to successful build a framework for Bitcode and archive in an Xcode 11 app project.


Still haven't maaged to get the build using the original xcodebuild command line arguments to work.


Hopefully this is fixed in BETA 5 or 6

Replies

I think I've found the underlying issue. I did a build in Xcode 11 (BETA 4) and noticed these warnings:


Showing All Messages

Could not find or use auto-linked library 'swiftFoundation'

Could not find or use auto-linked library 'swiftsimd'

Could not find or use auto-linked library 'swiftMetal'

Could not find or use auto-linked library 'swiftDarwin'

Could not find or use auto-linked library 'swiftCoreFoundation'

Could not find or use auto-linked library 'swiftos'

Could not find or use auto-linked library 'swiftQuartzCore'

Could not find or use auto-linked library 'swiftCore'

Could not find or use auto-linked library 'swiftCoreGraphics'

Could not find or use auto-linked library 'swiftObjectiveC'

Could not find or use auto-linked library 'swiftDispatch'

Could not find or use auto-linked library 'swiftAVFoundation'

Could not find or use auto-linked library 'swiftCoreMedia'

Could not find or use auto-linked library 'swiftCoreImage'

Could not find or use auto-linked library 'swiftCoreAudio'

Could not find or use auto-linked library 'swiftUIKit'


A search in the forums and I came across this post: https://forums.developer.apple.com/thread/120074


After doing the suggest comment add LD_VERIFY_BITCODE = NO to user defined build settings. I no longer got the error of my original post, the warnings disappeared and was able to successful build a framework for Bitcode and archive in an Xcode 11 app project.


Still haven't maaged to get the build using the original xcodebuild command line arguments to work.


Hopefully this is fixed in BETA 5 or 6