ios - 未绑定(bind)变量命令 PhaseScriptExecution 失败,退出代码非零

标签 ios xcode flutter build cocoapods

我是新来的。 android 部分构建成功,但 Xcode 部分构建失败。有人可以指出我需要做什么吗? (在 VSCode 或 Xcode 中)。我做的最后一件事是 1) 删除/iOS/Pods、Podfile.lock、Runner.xcworksp。 2)重新安装Pod(Pod Install),3)运行Product - Clean Build Folder,但构建过程仍然失败。

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/carlton/Library/Developer/Xcode/DerivedData/Runner-cjhgzdyvgdocfpacsknvjdqyoncu/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Script-8CA7D70C2DA13E40FDD92FF3.sh (in target 'Runner' from project 'Runner')
    cd /Users/carlton/Desktop/development/churchevent/ios
    /bin/sh -c /Users/carlton/Library/Developer/Xcode/DerivedData/Runner-cjhgzdyvgdocfpacsknvjdqyoncu/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Script-8CA7D70C2DA13E40FDD92FF3.sh

mkdir -p /Users/carlton/Library/Developer/Xcode/DerivedData/Runner-cjhgzdyvgdocfpacsknvjdqyoncu/Build/Products/Debug-iphonesimulator/Runner.app/Frameworks
rsync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/carlton/Desktop/development/churchevent/ios/Pods/../Flutter/Flutter.framework" "/Users/carlton/Library/Developer/Xcode/DerivedData/Runner-cjhgzdyvgdocfpacsknvjdqyoncu/Build/Products/Debug-iphonesimulator/Runner.app/Frameworks"
building file list ... done
Flutter.framework/
Flutter.framework/Flutter
Flutter.framework/Info.plist
Flutter.framework/icudtl.dat
Flutter.framework/_CodeSignature/
Flutter.framework/_CodeSignature/CodeResources

sent 94963025 bytes  received 120 bytes  189926290.00 bytes/sec
total size is 94951038  speedup is 1.00
/Users/carlton/Desktop/development/churchevent/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh: line 144: ARCHS[@]: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code


Showing Recent Issues

Build target Runner of project Runner with configuration Debug
warning: There are no architectures to compile for because the VALID_ARCHS build setting is an empty list. (in target 'Runner' from project 'Runner')


PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/carlton/Library/Developer/Xcode/DerivedData/Runner-cjhgzdyvgdocfpacsknvjdqyoncu/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Script-8CA7D70C2DA13E40FDD92FF3.sh (in target 'Runner' from project 'Runner')
    cd /Users/carlton/Desktop/development/churchevent/ios
    /bin/sh -c /Users/carlton/Library/Developer/Xcode/DerivedData/Runner-cjhgzdyvgdocfpacsknvjdqyoncu/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Script-8CA7D70C2DA13E40FDD92FF3.sh

mkdir -p /Users/carlton/Library/Developer/Xcode/DerivedData/Runner-cjhgzdyvgdocfpacsknvjdqyoncu/Build/Products/Debug-iphonesimulator/Runner.app/Frameworks
rsync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/carlton/Desktop/development/churchevent/ios/Pods/../Flutter/Flutter.framework" "/Users/carlton/Library/Developer/Xcode/DerivedData/Runner-cjhgzdyvgdocfpacsknvjdqyoncu/Build/Products/Debug-iphonesimulator/Runner.app/Frameworks"
building file list ... done
Flutter.framework/
Flutter.framework/Flutter
Flutter.framework/Info.plist
Flutter.framework/icudtl.dat
Flutter.framework/_CodeSignature/
Flutter.framework/_CodeSignature/CodeResources

sent 94963025 bytes  received 120 bytes  189926290.00 bytes/sec
total size is 94951038  speedup is 1.00
/Users/carlton/Desktop/development/churchevent/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh: line 144: ARCHS[@]: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code

这是第 144 行的代码
# Strip invalid architectures
strip_invalid_archs() {
  binary="$1"
  warn_missing_arch=${2:-true}
  # Get architectures for current target binary
  binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
  # Intersect them with the architectures we are building for
  intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
  # If there are no archs supported by this binary then warn the user
  if [[ -z "$intersected_archs" ]]; then
    if [[ "$warn_missing_arch" == "true" ]]; then
      echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
    fi
    STRIP_BINARY_RETVAL=0
    return
  fi
  stripped=""
  for arch in $binary_archs; do
    if ! [[ "${ARCHS}" == *"$arch"* ]]; then
      # Strip non-valid architectures in-place
      lipo -remove "$arch" -output "$binary" "$binary"
      stripped="$stripped $arch"
    fi
  done
  if [[ "$stripped" ]]; then
    echo "Stripped $binary of architectures:$stripped"
  fi
  STRIP_BINARY_RETVAL=1
}

最佳答案

你能提供一个flutter doctor --verbose日志? CocoaPods 抛出“Unbound Variable Command PhaseScriptExecution failed with a nonzero exit code”错误,不是由 Flutter SDK 直接引起的。您可以尝试发布在此 GitHub 问题线程 https://github.com/CocoaPods/CocoaPods/issues/8035 上的建议看看哪一个适合你。在我的测试中,删除/iOS/Pods、Podfile.lock、Runner.xcworkspace 会在 flutter run 之后重新生成.
供引用,这是我的 flutter 医生日志

[✓] Flutter (Channel master, 1.26.0-2.0.pre.281, on macOS 11.1 20C69 darwin-x64)
    • Flutter version 1.26.0-2.0.pre.281
    • Framework revision 4d5db88998 (3 weeks ago), 2021-01-11 10:29:26 -0800
    • Engine revision d5cacaa3a6
    • Dart version 2.12.0 (build 2.12.0-211.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Platform android-30, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0.1, Build version 12A7300
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.1

[✓] Connected device (2 available)
    • AOSP on IA Emulator (mobile) • emulator-5554 • android-x86    • Android 9 (API 28) (emulator)
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 88.0.4324.96

• No issues found!

关于ios - 未绑定(bind)变量命令 PhaseScriptExecution 失败,退出代码非零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60894849/

相关文章:

ios - 在 swrevealcontroller 之前实现登录屏幕

ios - 身份检查器中的模块字段用于什么?

xcode - 在 OS X Tableview 中显示的 Swift 核心数据

ios - 如何更改 iOS 应用程序的名称?

xcode - Apple TV无线调试无法连接

Flutter 制作垂直 appBar

android - 是否可以在不使用 Firebase 的情况下为移动设备实现自定义推送通知?

ios - 每次应用程序运行时,Realm 都会启动一个新数据库

image - 如何在我的 flutter 应用程序中访问特定目录中的文件

ios - 无法从collectionView中删除项目