Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #43

Closed
YuryBogdanov opened this issue Feb 20, 2019 · 4 comments · Fixed by #60

Comments

@YuryBogdanov
Copy link

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
@andrewspinks
Copy link
Collaborator

@YuryBogdanov thanks for reporting and providing a workaround. Will try and change the setting when I get a spare moment.

@narek-sv
Copy link

narek-sv commented Nov 2, 2020

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)

@mehmetmuratyazici
Copy link

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

@TheNuckingfut
Copy link

/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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants