Oleksandr Matrosov
Oleksandr Matrosov

Reputation: 27133

Xcode 7 ENABLE_BITCODE issue

I am not sure how to fix this issue:

ld: -weak_library and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together clang: error: linker command failed with exit code 1 (use -v to see invocation)

I switch ENABLE_BITCODE to NO in my target but it does not do anything with that issue.

I tried ENABLE_BITCODE = NO in my project settings as well though the same issue.

Upvotes: 0

Views: 939

Answers (1)

Oleksandr Matrosov
Oleksandr Matrosov

Reputation: 27133

As I use cocoa pods I've updated my pod file with this settings to set enable bitcode to NO state:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '9.0'
use_frameworks!
inhibit_all_warnings!

target 'MyProjectTargetName' do

pod 'YmsCoreBluetooth', '~> 1.10'
pod 'CrittercismSDK', '5.4.0'
pod 'XCGLogger', '~> 3.3'
pod 'TesseractOCRiOS', '~> 4.0'

end

post_install do |installer|

  installer.pods_project.targets.each do |target|
    installer.pods_project.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES' 
    end

    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
    end
  end
end

Upvotes: 1

Related Questions