在Xcode中從動(dòng)態(tài)庫剝離不需要的架構(gòu)自從iOS 8發(fā)布以來,開發(fā)人員已經(jīng)能夠利用動(dòng)態(tài)庫對(duì)iOS開發(fā)的好處。對(duì)于一般開發(fā),為所有需要的架構(gòu)設(shè)置一個(gè)單一的動(dòng)態(tài)庫是非常好的,所以您可以在所有設(shè)備和iOS模擬器上運(yùn)行,而無需更改任何東西。然而,這種方法有一個(gè)缺點(diǎn) - 因?yàn)樗鼈冊(cè)谶\(yùn)行時(shí)鏈接,當(dāng)一個(gè)動(dòng)態(tài)庫被單獨(dú)編譯到最終應(yīng)用程序時(shí),不可能知道實(shí)際需要哪些架構(gòu)。因此,Xcode將在編譯時(shí)將整個(gè)事物復(fù)制到應(yīng)用程序包中。除了浪費(fèi)的磁盤空間,理論上沒有真正的缺點(diǎn)。但是實(shí)際上,iTunes Connect不喜歡我們添加未使用的二進(jìn)制切片:這時(shí)候,打包上傳Appstore會(huì)報(bào)如下錯(cuò)誤: ![]() 那么,我們?nèi)绾谓鉀Q這個(gè)問題呢? ![]() 在Build Phases中加入run script。在里面添加Shell腳本,
該腳本將查看您構(gòu)建的應(yīng)用程序的Frameworks文件夾,并確保只有您正在構(gòu)建的架構(gòu)存在于每個(gè)框架中。
可解決環(huán)信HyphenateLite.framework上傳appstore報(bào)錯(cuò): 在使用環(huán)信HyphenateLite.framework時(shí),出現(xiàn)如下錯(cuò)誤: Code1:ERROR ITMS-90087: "Unsupported Architectures. The executable for MM_FESCO.app/Frameworks/HyphenateLite.framework contains unsupported architectures '[x86_64, i386]'." The executable for MM_FESCO.app/Frameworks/HyphenateLite.framework contains unsupported architectures '[x86_64, i386]'." The app binary at 'MM_FESCO.app/Frameworks/HyphenateLite.framework/HyphenateLite' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version." The app binary at 'MM_FESCO.app/Frameworks/HyphenateLite.framework/HyphenateLite' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version." The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker." is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables. For more information refer to Technical Q&A QA1788 - Building a Position Independent Executable in the iOS Developer Library." is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables. For more information refer to Technical Q&A QA1788 - Building a Position Independent Executable in the iOS Developer Library." |
|