【問題記錄】【Unity打包iOS】bitcode bundle could not be generated because xxx was built without full bitcode

報錯:
打包Archive的時候報錯:
ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/xxx/xxx/xxx/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
ld: bitcode bundle could not be generated because '/Users/xxx/xxx/xxx/Frameworks/xxx/Plugins/iOS/xxxSDK.framework/xxxSDK' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build file '/Users/xxx/xxx/xxx/Frameworks/xxx/Plugins/iOS/xxxSDK.framework/xxxSDK' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

原因:
導入的第三方庫不包含bitcode。
Bitcode是蘋果在Xcode7及以後推出的新功能。用於代碼的二次編譯,針對CPU進行優化,編譯工作由蘋果AppStore後臺來完成。
是bitcode是被編譯程序的一種中間形式的代碼。包含bitcode配置的程序將會在App store上被編譯和鏈接。bitcode允許蘋果在後期重新優化程序的二進制文件,而不需要重新提交一個新的版本到App store上。

解決:
1,讓第三方庫支持bitcode,(大多數情況下不太有效···)
2,關閉bitcode,"Build Setting" => "Build Options" => "Enable Bitcode" => "No"。可以在PROJECT中直接關閉,也可以在TARGETS中分別關閉。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章