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

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