ERROR ITMS-9000: “Unsupported architectures. Your executable contains unsupported architectures '[x86_64, i386]'”

前端 未结 4 1307
日久生厌
日久生厌 2020-12-29 12:23


It is impossible to send in itunesconnect new version of the application. Although last week, the same version send happened. In the code, I just changed the name of a

相关标签:
4条回答
  • 2020-12-29 13:01

    You can remove unwanted ARCHS from IPA by putting below peace of Shell Script in Build Phase -- > RUN Script This Script removes all simulator ARCHS from IPA and ARCH issues from Embedded framework. Source : http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/

    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
    
    0 讨论(0)
  • 2020-12-29 13:02

    Check out this slick solution on Daniel Kennett's blog - it worked perfectly for me with the SpritzSDK, which I had similar issues with.

    He supplies a script you can drop-in to your build phases to strip out the unwanted architectures as a last step - doesn't break the simulator, and iTunesConnect approved my upload as well on the first try.

    http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/

    0 讨论(0)
  • 2020-12-29 13:10

    The script in the above two answers needs to be edited if you have an watch app in your project. Add /Frameworks to the $APP_PATH to avoid errors when building the project.

    0 讨论(0)
  • 2020-12-29 13:16

    If you are using LiveSDK directly or via ShareKit, you will run into this problem. In my case I was using LiveSDK directly.

    Check this answer on Apple Developer Forum

    https://devforums.apple.com/message/1037603#1037603

    0 讨论(0)
提交回复
热议问题