karthi February 2016

BrainTree test flight upload unsupported architecture error

Xcode version 7.2 BrainTreeFramework 3.9.7

When i try to upload build to test flight getting unsupported architecture. I spent many hours on this.but no success. any help will be appreciated. thanks in advance

enter image description here

Answers


Anbu.Karthik February 2016

The problem is that the BrainTreeFramework contains a build for both the simulator (x86_64) and the actual devices (ARM).

you need to "manually" remove the unnedeed architectures from the final binary, before submitting it.

Daniel Kennett given a nice solution and provides this script to add to the build phase:

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

go through the link once it will work for me.

Post Status

Asked in February 2016
Viewed 1,674 times
Voted 9
Answered 1 times

Search




Leave an answer