iOS Flutter模块提交ipa Error 90087,90209,90125

最近在用Flutter开发的模块,在提交上架的时候,遇到如下问题了:

Flutter ipa error

原因:

这个Flutter编译的framework里面包含了x86_64, i386 [架构],在AppStore是不允许的,所有会在上传的时候报错,解决办法就是剔除掉x86_64, i386这两个架构;

解决

找了一下资料,发现都是在编译前,运行一段脚本,试了好多次,终于有一个版本是没问题,可以上传成功的,以下脚本可以直接复制使用;

  • 脚本路径如下图:


    Run Script
  • 脚本如下

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  

以上end,有问题,欢迎留言讨论;

如果脚本格式有误,可以从个人博客里复制即可

往期推荐:
如何用Pod集成Flutter
Flutter如何与iOS原生进行数据交互

你可能感兴趣的:(iOS Flutter模块提交ipa Error 90087,90209,90125)