Xcode 7和 ENABLE_BITCODE = YES 设置不起作用

我在 Xcode 新的 ENABLE _ BITCODE 设置上跟踪了几个线程,也尽我所能地尝试(承认我不是 Xcode 专家) ,但仍然不能让项目编译到我的测试手机上使用?

我的应用程序在模拟器上运行良好,但我不能将其部署到我的 iPhone 上进行测试。在后一个版本中,我刚刚安装了 iOS9测试版。

现在,下面是我收到的错误消息。看起来设置不会影响 PARSE.com 库,这是我项目的一部分?谢谢你的建议。

    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)
84268 次浏览

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

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

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.

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))

I just set it for my project.

MyProjectTarget -> Build Settings -> Enable Bitcode = NO

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

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

As everybody said, the answer is set ABC0 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!

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

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