在Xcode中从动态库剥离不需要的架构自从iOS 8发布以来,开发人员已经能够利用动态库对iOS开发的好处。对于一般开发,为所有需要的架构设置一个单一的动态库是非常好的,所以您可以在所有设备和iOS模拟器上运行,而无需更改任何东西。然而,这种方法有一个缺点 - 因为它们在运行时链接,当一个动态库被单独编译到最终应用程序时,不可能知道实际需要哪些架构。因此,Xcode将在编译时将整个事物复制到应用程序包中。除了浪费的磁盘空间,理论上没有真正的缺点。但是实际上,iTunes Connect不喜欢我们添加未使用的二进制切片:这时候,打包上传Appstore会报如下错误: ![]() 那么,我们如何解决这个问题呢? ![]() 在Build Phases中加入run script。在里面添加Shell脚本,
该脚本将查看您构建的应用程序的Frameworks文件夹,并确保只有您正在构建的架构存在于每个框架中。
可解决环信HyphenateLite.framework上传appstore报错: 在使用环信HyphenateLite.framework时,出现如下错误: 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." |
|