Errors building Xcode Project after adding in Run Script fatal error: lipo: input file

后端 未结 3 1539
感动是毒
感动是毒 2020-12-05 15:24

I had the following errors when attempting to upload my app to the App Store ERROR ITMS-90087, ERROR ITMS-90209, & ERROR ITMS-90125 as outlined in this Question Submit t

相关标签:
3条回答
  • 2020-12-05 16:01

    Well it seems that Bolts framework is not a fat binary (i.e. Does not contain multiple architectures binaries) hence the extraction and merging fails. I guess the simplest solution will be to run the script only for specific frameworks that comes with a binary for x86_64 arch. You can identify fat binaries using the 'file' command.

    0 讨论(0)
  • 2020-12-05 16:03

    What about just checking the "Run script only when installing" option?

    0 讨论(0)
  • 2020-12-05 16:23

    I've edited the script to try and identify if the framework is FAT. If it is, then it skips it.

    #!/usr/bin/env bash
    
    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"
    
        if [ ! -f "${FRAMEWORK_EXECUTABLE_PATH}" ]; then
            continue
        fi
    
        if xcrun lipo -info "${FRAMEWORK_EXECUTABLE_PATH}" | grep --silent "Non-fat"; then
            echo "Framework non-fat, skipping: $FRAMEWORK_EXECUTABLE_NAME"
            continue
        fi
    
        echo "Thinning framework $FRAMEWORK_EXECUTABLE_NAME"
    
        EXTRACTED_ARCHS=()
    
        for ARCH in $ARCHS
        do
            echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
            xcrun lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
            EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
        done
    
        echo "Merging extracted architectures: ${ARCHS}"
        xcrun 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)
提交回复
热议问题