由于添加了友盟分享,在真機(jī)調(diào)試的時(shí)候會(huì)有一個(gè)link的報(bào)錯(cuò),但是在模擬器的時(shí)候不會(huì)有這種情況。
原來是友盟的二進(jìn)制庫不支持bitcode.
而Xcode默認(rèn)是要支持bitcode的,而且如果支持的話,其中所有的二進(jìn)制庫和framework都必須包含bitcode.
至于什么是bitcode,請看這里:
官方文檔
Bitcode (iOS, watchOS)
Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.
Xcode hides symbols generated during build time by default, so they are not readable by Apple. Only if you choose to include symbols when uploading your app to iTunes Connect would the symbols be sent to Apple. You must include symbols to receive crash reports from Apple.
Note:For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS apps, bitcode is required.
Bitcode 是編譯的應(yīng)用程序的中間一種形式.你提交到AppStore上的應(yīng)用程序包含的bitcode會(huì)在AppStore上被編譯和鏈接.在未來包含bitcode的應(yīng)用程序,會(huì)讓Apple重新優(yōu)化你的二進(jìn)制文件而不需要重新提交新的版本.意思就是加入蘋果會(huì)更換硬件架構(gòu)(CPU之類的).開發(fā)者也不需要再根據(jù)不同的平臺開發(fā)新的軟件.Xcode在編譯時(shí)默認(rèn)是隱藏symbols的.所以Apple拿不到symbols.只有在你提交APP 到 iTunes Connect時(shí)選擇了提交symbols.Apple才會(huì)拿到程序的symbols.如果你想要收到Apple的crash 報(bào)告的話.必須要把symbols提交上去.
注意: iOS APP,bitcode是默認(rèn)的.但是不是必須的.但是你如果支持bitcode的話,那么應(yīng)用中的的app和frameworks都必須包含bitcode.對watchOS app來說,bitcode是必須的.
總的來說,bitcode是一種介于LLVM編譯器和編程語言的一種中間態(tài).雖然bitcode不能在任何平臺上運(yùn)行,但是它可以轉(zhuǎn)換成任何所支持的CPU架構(gòu).
方法是在設(shè)置里面把bitcode設(shè)置為no.