问题
送审时反馈:
ERROR ITMS-90087: "Unsupported Architectures. The executable for xxx.app/Frameworks/xxxx.framework contains unsupported architectures '[i386, x86_64]'."
ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'xxx.app/Frameworks/xxxx.framework/xxxx' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
是由于framework中包含i386和x86_64这两个模拟器架构
解决方案
-
方案一:让厂家修改framework架构
-
方案二:自己处理:
- 把framework中的模拟器框架剥离处理,参考这里。
- 用脚本设置在构筑阶段进行架构处理:
-
处理方式:
添加脚本地址:$PROJECT_DIR/FremaworkScript.sh
脚本内容如下:
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done
网友评论