Buildbox 3.2.0 Facebook Sdk Ios Fix App Store Distribution (error: Architectures [i386, X86_64])

Discussion in 'Buildbox 3.0' started by Karim MS, Apr 6, 2020.

  1. Karim MS

    Karim MS Boxer

    Joined:
    Mar 20, 2020
    Messages:
    5
    Likes Received:
    5
    Hi everyone,

    Yesterday I tried to upload my .ipa to App Store Connect (you can follow this tutorial : https://www.buildbox.com/guides/publish-apple-build/) problem is I got errors like this one :

    App Store Connect Operation Error Unsupported Architectures. The executable for BBPlayer.app/Frameworks/FBSDKCoreKit.framework contains unsupported architectures '[i386, x86_64]'.

    [​IMG]

    To fix this issue I found a solution here : http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/ (thank you Daniel Kennett).

    This script makes sure you only use armv7 and arm64 for distribution which are for devices and not include i386, x86_64 which are for simulators.

    This is where you add the script in Xcode / Build Phases click on + button on top left > New Run Script Phase, make sure it's after Embed Frameworks.

    [​IMG]


    By default the shell use /bin/sh.

    Then just copy paste the script.

    SCRIPT :
    ########
    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

    ########

    Now you are good to go, you can archive, validate and then distribute.
     
    mohamed awad, andsy and eggchell like this.
  2. eggchell

    eggchell Boxer

    Joined:
    Jun 4, 2019
    Messages:
    6
    Likes Received:
    2
    Nice!

    I had the same issue and this solution worked for me

    Thanks @Karim MS
     
    Karim MS likes this.
  3. andsy

    andsy Boxer

    Joined:
    Jan 24, 2019
    Messages:
    38
    Likes Received:
    11
    Thanks man!

    I searched for a solution for 3h !

    Thanks!
     
    Karim MS likes this.
  4. shahar.m192

    shahar.m192 Avid Boxer

    Joined:
    Oct 7, 2018
    Messages:
    204
    Likes Received:
    44
    well, I think the new update fix all these issues I put the bundle id from Facebook and the name of the game and put it into the software with the new update 3.2
     
  5. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
    What could i say Karim MS,
    You saved me,
    Thanks.
     
    Karim MS likes this.

Share This Page