ipa送审Unsupported Architectures问题

作者: freesan44 | 来源:发表于2020-06-17 18:19 被阅读0次

    问题

    送审时反馈:

    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这两个模拟器架构

    解决方案

    1. 方案一:让厂家修改framework架构

    2. 方案二:自己处理:

      1. 把framework中的模拟器框架剥离处理,参考这里
      1. 用脚本设置在构筑阶段进行架构处理:
    1. 处理方式:




      添加脚本地址:$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
    

    相关文章

      网友评论

        本文标题:ipa送审Unsupported Architectures问题

        本文链接:https://www.haomeiwen.com/subject/zzosxktx.html