You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file
YuryBogdanov opened this issue · 4 comments
HI!
I've been trying to build and run an application which Test target depends on PactConsumerSwift (via CocoaPods) on a real device and encountered this error:
ld: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Apparently, this happens due to enabled bitcode (although it shouldn't be). PactConsumerSwift's dependency (Nimble) had the same issue, which was successfully resolved.
So in order to fix it we should set 'ENABLE_BITCODE' to 'NO' in the podspec.
I will try to fix this on my own if I'll have some time. If you face this problem too, the workaround is to put this to your Podfile:
post_install do |installer|
if target.name == 'PactConsumerSwift'
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
@YuryBogdanov thanks for reporting and providing a workaround. Will try and change the setting when I get a spare moment.
problem still exists for me, when trying to build on a real device (iPhone XS, iOS 14.1, XCode 12.1)
post_install do |installer|
if target.name == 'PactConsumerSwift'
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
^ This workaround doesn't help at all
Here is the log
ld: '/Users/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Debug-iphoneos/PactConsumerSwift/PactConsumerSwift.framework/PactConsumerSwift' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Debug-iphoneos/PactConsumerSwift/PactConsumerSwift.framework/PactConsumerSwift' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Goto project build setting and select all category and search enable bitcode then change value to 'no' . i hope, your problem will solve when you try this way
/Users/ash/Library/Developer/Xcode/DerivedData/OurMedic-bapnfuizhclfdoebricslzqsjtfv/Build/Products/Debug-iphoneos/AWSAuthCore/AWSAuthCore.framework/AWSAuthCore' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/ash/Library/Developer/Xcode/DerivedData/OurMedic-bapnfuizhclf