我已经围绕 Xcode 中的新 ENABLE_BITCODE 设置跟踪了几个线程,也尽可能多地尝试(承认我不是 xcode 专业人士)但仍然无法编译项目以在我的测试手机上使用?
我的应用程序在模拟器上运行良好,但我无法将其部署到我的 iPhone 上进行测试。在后一个上,我刚刚安装了 iOS 9 beta。
现在,这是我收到的错误消息。看来该设置不会影响 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)
DEBUG
)选择了 Enable Bitcode
到 NO
?您可以在项目->目标->构建设置->中查看。在 DEBUG 中搜索 enable bitcode
->set NO
(记住在测试发布之前尝试更新库,也许它已经包含位码)。然后 Edit Scheme
-> Run
->检查您是否有 DEBUG
配置 atm。
您确定针对您正在使用的构建配置(例如 DEBUG
)选择了 Enable Bitcode
到 NO
?您可以在项目->目标->构建设置->中查看。在 DEBUG
中搜索 enable bitcode
->set NO
(记得在测试发布之前尝试更新库,也许它已经包含位码)。然后编辑方案->运行->检查您是否有 DEBUG
配置 atm。
https://i.stack.imgur.com/BGTkB.png
请注意,对于使用 CocoaPods 的项目,您应该在项目和 Pods 容器项目目标上设置 ENABLE_BITCODE = NO
。
这个错误
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)
通过以下方式解决:
https://i.stack.imgur.com/KlEj3.png
https://i.stack.imgur.com/K3189.png
我在 Xcode7 中也遇到过同样的问题。解决方案:
去项目
构建设置
选择所有选项卡
输入搜索启用位码
将标志更新为否(将在您的项目下方(第二列))
我在使用 GoogleAnalytics 可可豆库时遇到了类似的问题,并且该库没有针对带有 iOS 8 的 iPhone 6 进行编译。
我的解决方案是在应用程序项目的目标中转向 NO“启用位码”标志 - 而不是在 Pods 项目中。
如果您的位码未显示,请选择全部。当 xcode 选择 Basic 时,您的 Bitcode 选项未显示。
https://i.stack.imgur.com/M5qn7.png
https://i.stack.imgur.com/TKmWL.png
我只是为我的项目设置它。
MyProjectTarget -> 构建设置 -> 启用 Bitcode = NO
正如大家所说,答案是在构建设置中将 Enable Bitcode
设置为 No
,但我想你们中的一些人可能有兴趣从 命令行 执行此操作。
我的 Xcode 项目是由 Unity 生成的,我不希望对 Xcode 项目设置进行任何手动干预。也许有更好的方法或工具可以编辑构建设置,有点像 PlistBuddy 让您更新 plist
文件中的值。我不知道有任何工具可以为构建设置执行此操作,因此我使用的是 sed。
sed:基于正则表达式运行替换。
如何从命令行将 Enable Bitcode 设置为 No:
在这里,我的项目名称是 Unity-iPhone
,因此我从 Xcode 项目的根目录运行以下命令:
sed -i -e 's/ENABLE_BITCODE = YES;/ENABLE_BITCODE = NO;/g' \
Unity-iPhone.xcodeproj/project.pbxproj
-e -- 指定要运行的 sed 命令 -i -- 就地编辑文件,为每个文件单独运行脚本
如果您只想预览它的功能,请删除 -i
;)
请注意,所有您的构建配置都将使用此命令进行更改,行 ENABLE_BITCODE = YES;
在我的 project.pbxproj
中出现了 6 次。
现在我的构建步骤可以完全自动化,因为 fastlane 会负责其余的工作!
https://i.stack.imgur.com/JjdaZ.png
如果您无法在项目中更改 BITCODE 设置,请在终端中尝试此命令,
xcodebuild -target "target" -configuration "configuration" ENABLE_BITCODE=NO
如果您使用的是 Cocoapods,这将解决问题:
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
Enable Bitcode
设置为NO
,应用程序是否会在 App Store 中被接受?