项目准备上线的时候,打包ipa上传Appstore,出现报错,如下:
ERROR ITMS-90087: "Unsupported Architectures. The executable for ****.framework contains unsupported architectures '[x86_64, i386]'."
ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at ****.framework does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
ERROR ITMS-90125: "The binary is invalid. 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."
看错误信息,才知道,项目中引用了第三方SDK里有个****.framework库,该库支持三种架构,“x86_64 armv7 arm64 ”,而带有这些二进制文件的ipa是不能上传AppStore的。上传AppStore是不能包含x86_64或i386这种结构的。
去查看第三方的framework框架支持的架构,如下(如框架名称为:AysnClipCore.framework)
cd /Users/******/Downloads/lib/ios/AysnClipCore.framework //进入该framework目录
lipo -info AysnClipCore
看到AysnClip支持的架构信息如下:
Architectures in the fat file: AysnClipCore are: x86_64 armv7 arm64
现在既然上传不可以带x86_64,那现在就需要把该架构从AysnClipCore中去掉,方法如下:
lipo AysnClipCore.framework/AysnClipCore -thin arm64 -output AysnClipCore.framework/AysnClipCore-arm64
lipo AysnClipCore.framework/AysnClipCore -thin armv7 -output AysnClipCore.framework/AysnClipCore-armv7
lipo -create AysnClipCore_armv7 AysnClipCore_arm64 -output NvStreamingSdkCore //合成一个支持armv6和arm64架构的framework
最后,用新合成的去掉x86_64架构,仅支持armv7和arm64架构的framework替换掉原来的,重新打包ipa上传AppStore,upload successfully!
上传成功!