Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code

前端 未结 25 822
醉梦人生
醉梦人生 2020-11-28 08:20
Showing Recent Messages:-1: mkdir -p /Users/spritzindia/Library/Developer/Xcode/DerivedData/Contigo-atftiouzrdopcmcpprphpilawwzm/Build/Products/Debug-iphonesimulator         


        
相关标签:
25条回答
  • 2020-11-28 08:50

    I was able to resolve this error by remove file in Pods -> Targets Support Files -> Pods-AppName -> Pods-AppName-frameworks.sh. After removing that file again install pod using command pod install.

    OR.

    Try this:

    -> quit xcode -> install pod(again) -> start xcode

    0 讨论(0)
  • 2020-11-28 08:50

    Try this!

    Build phases > Add > New Run Script Phase

    Code:

    # Type a script or drag a script file from your workspace to insert its path.
    # skip if we run in debug
    if [ "$CONFIGURATION" == "Debug" ]; then
    echo "Skip frameworks cleaning in debug version"
    exit 0
    fi
    
    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
    

    Xcode will refuse to sign them. The above script removes unused architectures.

    0 讨论(0)
  • 2020-11-28 08:51

    If you are doing Unity Project. You can get this error.

    Command PhaseScriptExecution failed with a nonzero exit code
    

    The solution is very simple

    https://forum.unity.com/threads/error-on-build.561706/

    Pre-requisites: Have cocoapods installed

    1. Install "cocoapods" for installing run following line in your terminal: $sudo gem install cocoapods
    2. Open your project folder using terminal
    3. Run this line: chmod +x MapFileParser.sh
    4. Run this line: chmod +x process_symbols.sh

    It worked for me)

    I think that installing "cocoapods" is not necessary, only step 3 and 4 enough to solve, but it does not work, you can try it.

    0 讨论(0)
  • 2020-11-28 08:52

    After trying all the solutions, I was missing is to enable this option in:

    Targets -> Build Phases -> Embedded pods frameworks

    In newer versions it may be listed as:

    Targets -> Build Phases -> Bundle React Native code and images

    • Run script only when installing

    0 讨论(0)
  • 2020-11-28 08:52

    Try the below:

    1. pod deintegrate
    2. pod install
    3. XCode Clean build

    Or, One-Liner:

    pod deintegrate; pod install

    0 讨论(0)
  • 2020-11-28 08:52

    Take Pods-resources.sh from project path and paste in Terminal

    sudo chmod a+x "Pods-resources.sh file path here"
    

    Example Usage:

    sudo chmod a+x "/Users/path/Desktop-path/My Work-path/Pods/Pods-resources.sh"
    
    0 讨论(0)
提交回复
热议问题