clang: error: linker command failed with exit code 1 (use -v to see invocation)

iOS 9.0更新碰到:第三方庫不包含bitcode
運(yùn)行錯(cuò)誤提示 某一個(gè)第三方庫不包含bitcode? bitcode?是什么,以前沒有注意過。
查閱了一下官方文檔,在App

Distribution Guide–App Thinning (iOS, watchOS)一節(jié)中,找到了下面這樣一個(gè)定義:

Bitcode is an intermediate representationof a compiled program. Apps you upload to iTunes Connect that contain bitcodewill be compiled and linked on the App Store. Including bitcode will allowApple to re-optimize your app binary in the future without the need to submit anew version of your app to the store.

Bitcode是一個(gè)中級(jí)representationof編譯程序。應(yīng)用程序上傳iTunes Connect包含bitcodewill編譯和鏈接在App Store。包括bitcode將來allowApple優(yōu)化你的應(yīng)用程序二進(jìn)制而不需要重新提交版本的應(yīng)用程序商店。

而在What’s New in Xcode-New Features in Xcode 7中,還有一段如下的描述:

Bitcode. When you archive for submission tothe App Store, Xcode will compile your app into an intermediate representation.The App Store will then compile the bitcode down into the 64 or 32 bitexecutables as necessary.

Bitcode。當(dāng)你檔案提交到應(yīng)用程序商店,Xcode將編譯你的應(yīng)用程序到一個(gè)中間表示。App Store將編譯bitcode分成64或32 bitexecutables是必要的。

再看看這兩段描述,都是放在App Thinning(App瘦身)一節(jié)中,可以看出其與包的優(yōu)化有關(guān)了。

Bitcode配置

在上面的錯(cuò)誤提示中,提到了如何處理我們遇到的問題:

You must rebuild it with bitcode enabled(Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, ordisable bitcode for this target. for architecture arm64

你必須重建它啟用了bitcode(Xcode設(shè)置ENABLE_BITCODE),從供應(yīng)商獲得一個(gè)更新的庫,ordisable bitcode這個(gè)目標(biāo)。建筑arm64

現(xiàn)在有兩種解決方式:

1.讓第三方庫支持,
2.關(guān)閉target的bitcode選項(xiàng)。我現(xiàn)在所使用的方法就是將bitcode關(guān)閉
在Xcode 7中,我們新建一個(gè)iOS程序時(shí),bitcode選項(xiàng)默認(rèn)是設(shè)置為YES的。我們可以在”Build Settings”->”Enable Bitcode”選項(xiàng)中看到這個(gè)設(shè)置


iOS 9.0更新碰到:第三方庫不包含bitcode - Yuan_ios - 616499035的博客

將Enable Bitcode默認(rèn)的YES 選項(xiàng)改成NO 就行了希望對(duì)遇到類似問題朋友有所幫助

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容