96

I have followed several threads around the new ENABLE_BITCODE setting in Xcode, have also tried as much as I can (admitted I'm not a xcode pro) but still cannot get the project to compile for use on my test phone?

My app runs fine on the simulator but I cannot deploy it onto my iPhone for testing. On latter one I just installed iOS 9 beta.

Now, here is the error message I receive. It appears the setting does not impact the PARSE.com lib, that is part of my project? How can I get my project to deploy onto my phone? Thanks for any advice.

    Ld /Users/xxxxxx/Library/Developer/Xcode/DerivedData/graffiti-  bnmizxueojwiqcbbnsvilljhosrw/Build/Products/Debug-iphoneos/Pods/Parse.framework/Parse normal armv7
cd /Users/xxxxxx/Documents/DigitalTempusDev/graffiti/Pods
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -dynamiclib -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/xxxxxx/Library/Developer/Xcode/DerivedData/graffiti-bnmizxueojwiqcbbnsvilljhosrw/Build/Products/Debug-iphoneos/Pods -L/Users/xxxxxx/Documents/DigitalTempusDev/graffiti/Pods/Parse -F/Users/xxxxxx/Library/Developer/Xcode/DerivedData/graffiti-bnmizxueojwiqcbbnsvilljhosrw/Build/Products/Debug-iphoneos/Pods -filelist /Users/xxxxxx/Library/Developer/Xcode/DerivedData/graffiti-bnmizxueojwiqcbbnsvilljhosrw/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-Parse.build/Objects-normal/armv7/Parse.LinkFileList -install_name @rpath/Parse.framework/Parse -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -miphoneos-version-min=8.0 -dead_strip -fembed-bitcode-marker -ObjC -lParseLib -lz -framework AudioToolbox -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework QuartzCore -framework Security -framework StoreKit -framework SystemConfiguration -weak_framework Accounts -weak_framework Social -ObjC -fobjc-arc -fobjc-link-runtime -framework AudioToolbox -framework Bolts -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework Foundation -framework QuartzCore -framework Security -framework StoreKit -framework SystemConfiguration -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/xxxxxx/Library/Developer/Xcode/DerivedData/graffiti-bnmizxueojwiqcbbnsvilljhosrw/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-Parse.build/Objects-normal/armv7/Parse_dependency_info.dat -o /Users/xxxxxx/Library/Developer/Xcode/DerivedData/graffiti-bnmizxueojwiqcbbnsvilljhosrw/Build/Products/Debug-iphoneos/Pods/Parse.framework/Parse

---
ld: warning: -weak_framework is treated as -framework when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES). Weak linking may still happen based on availability mark-up in headers
ld: warning: -weak_framework is treated as -framework when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES). Weak linking may still happen based on availability mark-up in headers
ld: '/Users/xxxxxx/Documents/DigitalTempusDev/graffiti/Pods/Parse/libParseLib.a(PFSQLiteDatabase.o)' 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. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Cœur
  • 37,241
  • 25
  • 195
  • 267
DirkLX
  • 1,317
  • 1
  • 10
  • 16
  • 1
    Are you sure you've selected `Enable Bitcode` to `NO` against build config you're using (eg `DEBUG`)? You can check it out in project->target->build settings-> search `enable bitcode`->set `NO` in DEBUG (good to remember to try to update libs before test release, maybe it'll contain bitcode already). Then `Edit Scheme` -> `Run` -> check if you have `DEBUG` config atm. – Nat Jul 22 '15 at 12:14
  • 1
    WELL! yes and no. I did not set it on the POD targets, that was my overlook. Your hint got me there. Thanks – DirkLX Jul 22 '15 at 12:59
  • Great to hear it :) will post it as an answer as it may be useful for other people. – Nat Jul 22 '15 at 13:00
  • Why we need to change Bitcode? Previously we not need to update its value. Any logical reason? Thanks – msmq Sep 28 '15 at 10:19
  • Did it all but still the app crash on the device with the same error. I am using iOS 9.1. Please help! – Md Rais Dec 09 '15 at 14:37

10 Answers10

135

Are you sure you've selected Enable Bitcode to NO against build config you're using (eg DEBUG)? You can check it out in project->target->build settings-> search enable bitcode->set NO in DEBUG (good to remember to try to update libs before test release, maybe it'll contain bitcode already). Then Edit Scheme -> Run -> check if you have DEBUG config atm.

enter image description here

Zorayr
  • 23,770
  • 8
  • 136
  • 129
Nat
  • 12,032
  • 9
  • 56
  • 103
  • 1
    @Zorayr As you've added image to my post: you should firstly check your app build settings and change this flag in app build settings. Only if it doesn't help, then do the same with Pods. – Nat Aug 03 '15 at 14:07
  • 3
    Will the application be accepted in the App store if the `Enable Bitcode` is set to `NO` ? – Ne AS May 15 '17 at 14:53
  • @NeAS Yes. Currently, there is no requirement to enable bitcode. – Nat Jun 10 '18 at 18:37
55

Note that for projects using CocoaPods you should set ENABLE_BITCODE = NO on both the project and the Pods container project targets.

This error

Ld /Users/maximveksler/Library/Developer/Xcode/DerivedData/ParseUI-gwtgmlgbpobjfjfjgkiwdahqveos/Build/Products/Debug-iphoneos/ParseTwitterUtils.framework/ParseTwitterUtils normal arm64
    cd /Users/maximveksler/Developer/ParseUI-iOS/Pods
    export IPHONEOS_DEPLOYMENT_TARGET=9.0
    export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -dynamiclib -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/maximveksler/Library/Developer/Xcode/DerivedData/ParseUI-gwtgmlgbpobjfjfjgkiwdahqveos/Build/Products/Debug-iphoneos -L/Users/maximveksler/Developer/ParseUI-iOS/Pods/ParseTwitterUtils -F/Users/maximveksler/Library/Developer/Xcode/DerivedData/ParseUI-gwtgmlgbpobjfjfjgkiwdahqveos/Build/Products/Debug-iphoneos -filelist /Users/maximveksler/Library/Developer/Xcode/DerivedData/ParseUI-gwtgmlgbpobjfjfjgkiwdahqveos/Build/Intermediates/Pods.build/Debug-iphoneos/ParseTwitterUtils.build/Objects-normal/arm64/ParseTwitterUtils.LinkFileList -install_name @rpath/ParseTwitterUtils.framework/ParseTwitterUtils -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -fembed-bitcode-marker -ObjC -lParseTwitterUtilsLib -lsqlite3 -lz -framework AudioToolbox -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework QuartzCore -framework Security -framework StoreKit -framework SystemConfiguration -weak_framework Accounts -weak_framework Social -fobjc-arc -fobjc-link-runtime -framework AudioToolbox -framework Bolts -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework Foundation -framework Parse -framework QuartzCore -framework Security -framework StoreKit -framework SystemConfiguration -single_module -compatibility_version 1 -current_version 1.8.1 -Xlinker -dependency_info -Xlinker /Users/maximveksler/Library/Developer/Xcode/DerivedData/ParseUI-gwtgmlgbpobjfjfjgkiwdahqveos/Build/Intermediates/Pods.build/Debug-iphoneos/ParseTwitterUtils.build/Objects-normal/arm64/ParseTwitterUtils_dependency_info.dat -o /Users/maximveksler/Library/Developer/Xcode/DerivedData/ParseUI-gwtgmlgbpobjfjfjgkiwdahqveos/Build/Products/Debug-iphoneos/ParseTwitterUtils.framework/ParseTwitterUtils

ld: '/Users/maximveksler/Developer/ParseUI-iOS/Pods/ParseTwitterUtils/libParseTwitterUtilsLib.a(PFTwitterAuthenticationProvider.o)' 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. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

was resolved by:

enter image description here

enter image description here

Maxim Veksler
  • 29,272
  • 38
  • 131
  • 151
  • Does Apple reject app if we submit it with option Enable Bitcode = NO? – Ganesh G Oct 07 '15 at 06:52
  • @G.Ganesh please post as a separate question. The policy varies between tvOS and watchOS where the answer is YES. iOS the answer is currently no, future YES. – Maxim Veksler Oct 07 '15 at 06:54
  • @GaneshGuturi Currently yes, but probably Apple will cut it at some point in the future. More explanation eg here: http://stackoverflow.com/a/31207170/849616. – Nat May 15 '17 at 15:20
17

I had also faced the same problem in Xcode7. Solution for this:

  • go to PROJECT
  • build Settings
  • select All Tab
  • type in search Enable Bitcode
  • Update Flag to No (which will be beneath of your project (second column))
Stefan Stoichev
  • 4,615
  • 3
  • 31
  • 51
Harshal Wani
  • 2,249
  • 2
  • 26
  • 41
16

I had similar problem with GoogleAnalytics cocoa pod library, and the library was not compiling for iPhone 6 with iOS 8.

My solution was to turn to NO "Enable Bitcode" flag in target of the application project - not in Pods project.

ArturOlszak
  • 2,653
  • 2
  • 21
  • 20
  • That's what I've said in the comment to my answer. To try to do it on project settings, if and only if that's not working then switch to pod project. – Nat Sep 22 '15 at 10:52
  • Switching the target and the project to build settings bitcode NO does not work for ARCHIVING. Does work find for Sim builds. XCODE 7.0.1 – ort11 Oct 01 '15 at 15:03
11

If your Bitcode is not showing please selec All. When xcode select Basic your Bitcode option is not showing.

enter image description here

When you select All you can see Bitcode. After then set No for ads config enter image description here

ethemsulan
  • 2,241
  • 27
  • 19
10

I just set it for my project.

MyProjectTarget -> Build Settings -> Enable Bitcode = NO

Alexander
  • 9,074
  • 2
  • 15
  • 13
5

As everybody said, the answer is set Enable Bitcode to No in build settings, but I think some of you might be interested in doing this from the command line.

My Xcode project is being generated by Unity and I don't want any manual intervention on the Xcode project settings. Maybe there's a better way or a tool that can edit Build Settings a bit like how PlistBuddy lets you update values in plist files. I don't know any tool that does this for build settings so I'm using sed.

sed: Run replacements based on regular expressions.

How to set Enable Bitcode to No from command line:

Here, my project name is Unity-iPhone so I run the following command from the root of my Xcode project:

sed -i -e 's/ENABLE_BITCODE = YES;/ENABLE_BITCODE = NO;/g' \ 
Unity-iPhone.xcodeproj/project.pbxproj

-e -- specify sed commands to run
-i -- edit files in-place, running scripts separately for each file

Remove -i if you only want a preview of what it does ;)

Note that all of your build configurations will be changed using this command, the line ENABLE_BITCODE = YES; appeared 6 times in my project.pbxproj.

Now my build steps can be fully automated as fastlane takes care of the rest!

GabLeRoux
  • 16,715
  • 16
  • 63
  • 81
4

If you don't find enable_bitcode flag. Click "All" tab on the upper toolbar beside the search bar. enter image description here

1

try this command in terminal if you arn't able to change BITCODE settings withing the project,

xcodebuild -target "target" -configuration "configuration" ENABLE_BITCODE=NO

Jaxs_ios
  • 48
  • 10
1

If you are using Cocoapods, this will solve the problem:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end
Hugo Jordao
  • 786
  • 8
  • 9