Xcode 14.0 command PhaseScriptExecution failed with a nonzero exit code

回答 2 浏览 1.3万 2022-09-18
Aqib shahzad 提问于2022-09-18
检查您的flutter项目上的包,可能有些包已经过期了。Arbiter Chil 2022-09-18
2 个回答
#1楼 已采纳
得票数 5

点击项目的属性,进入build phases,勾选选项"For install builds only"。

enter image description here

Thiago Loureiro 提问于2022-09-27
在安装构建时,它是没有用处的。Ten 2022-10-06
它将使你的脚本失效。这可能会使你的代码运行错误。Ten 2022-10-10
#2楼
得票数 0

也许问题出在"Run script"上。

例如:我把Firebase crashlytics从"pod"改成了"packeges"。 但我没有改变脚本。 我已经试过了所有的解决方案。

“https://stackoverflow.com/questions/53289524/xcode-10-2-1-command-phasescriptexecution-failed-with-a-nonzero-exit-code”

我的解决方案是改变TARGETS -> Build Phases。在脚本字段表单中

"${PODS_ROOT}/FirebaseCrashlytics/run"

"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"

简而言之,问题出在你的脚本上,要做的是正确的。

如果Scrip只进行安装构建。你需要Targets -> Build Phases -> Run Scrip -> check "For install builds only"

比如:

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
Ten 提问于2022-10-07
Ten 修改于2022-10-10
我遇到了完全相同的情况,这对我很有效,谢谢你!"。Pontus 2022-11-02
标签