Car*_*ter 5 xcode build ios cocoapods flutter
我是扑的新手。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
Run Code Online (Sandbox Code Playgroud)
这是第 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
}
Run Code Online (Sandbox Code Playgroud)
能提供一下flutter doctor --verbose日志吗?“Unbound Variable Command PhaseScriptExecution failed with a nonzero exit code”错误是由 CocoaPods 引发的,而不是由 Flutter SDK 直接引起的。您可以尝试此 GitHub 问题线程https://github.com/CocoaPods/CocoaPods/issues/8035上发布的建议,看看哪一个可能适合您。在我的测试中,删除 /iOS/Pods、Podfile.lock、Runner.xcworkspace 之后会重新生成flutter run。
作为参考,这是我的 flutter doctor 日志
\n[\xe2\x9c\x93] Flutter (Channel master, 1.26.0-2.0.pre.281, on macOS 11.1 20C69 darwin-x64)\n \xe2\x80\xa2 Flutter version 1.26.0-2.0.pre.281\n \xe2\x80\xa2 Framework revision 4d5db88998 (3 weeks ago), 2021-01-11 10:29:26 -0800\n \xe2\x80\xa2 Engine revision d5cacaa3a6\n \xe2\x80\xa2 Dart version 2.12.0 (build 2.12.0-211.0.dev)\n\n[\xe2\x9c\x93] Android toolchain - develop for Android devices (Android SDK version 29.0.2)\n \xe2\x80\xa2 Platform android-30, build-tools 29.0.2\n \xe2\x80\xa2 Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java\n \xe2\x80\xa2 Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)\n \xe2\x80\xa2 All Android licenses accepted.\n\n[\xe2\x9c\x93] Xcode - develop for iOS and macOS (Xcode 12.0.1)\n \xe2\x80\xa2 Xcode at /Applications/Xcode.app/Contents/Developer\n \xe2\x80\xa2 Xcode 12.0.1, Build version 12A7300\n \xe2\x80\xa2 CocoaPods version 1.10.0\n\n[\xe2\x9c\x93] Chrome - develop for the web\n \xe2\x80\xa2 Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome\n\n[\xe2\x9c\x93] Android Studio (version 4.1)\n \xe2\x80\xa2 Android Studio at /Applications/Android Studio.app/Contents\n \xe2\x80\xa2 Flutter plugin can be installed from:\n https://plugins.jetbrains.com/plugin/9212-flutter\n \xe2\x80\xa2 Dart plugin can be installed from:\n https://plugins.jetbrains.com/plugin/6351-dart\n \xe2\x80\xa2 Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)\n\n[\xe2\x9c\x93] VS Code (version 1.52.1)\n \xe2\x80\xa2 VS Code at /Applications/Visual Studio Code.app/Contents\n \xe2\x80\xa2 Flutter extension version 3.18.1\n\n[\xe2\x9c\x93] Connected device (2 available)\n \xe2\x80\xa2 AOSP on IA Emulator (mobile) \xe2\x80\xa2 emulator-5554 \xe2\x80\xa2 android-x86 \xe2\x80\xa2 Android 9 (API 28) (emulator)\n \xe2\x80\xa2 Chrome (web) \xe2\x80\xa2 chrome \xe2\x80\xa2 web-javascript \xe2\x80\xa2 Google Chrome 88.0.4324.96\n\n\xe2\x80\xa2 No issues found!\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
2861 次 |
| 最近记录: |