上架App Store出现x86_64, i386 架构错误

 

更新:最近又要上架,发现即使有了下面的脚本,但是使用xcode模拟器调试过,又报错。

解决办法:必须重新把工程编译缓存清空,操作如下:Product ->clean,按住Alt变成 clean build Folder...,等待操作完成,把自定义、第三方framework剔除掉x86_64, i386这两个架构的模拟设备缓存,再重新打包上传。

------------------------------------------------------------------------------------------------

1.最近更新了项目DFU功能中Zip.framework,提交App Store时候报错了

2.自建或者第三方的framework里面包含了x86_64, i386 架构,当然这个AppStore是不允许的,所有会在上传的时候报错,解决办法就是要这个framework剔除掉x86_64, i386这两个架构

3.解决办法:TARGETS->Build Phases->点击加号选择New Run Script Phase->然后复制粘贴下面代码

上架App Store出现x86_64, i386 架构错误_第1张图片

脚本代码:

    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

参考:https://blog.csdn.net/wujakf/article/details/69666203?utm_source=copy 

你可能感兴趣的:(上架App Store出现x86_64, i386 架构错误)