我按照 Flutter 文档进行了安装等操作。下载了 Zip 并解压缩到我自己的开发目录。我添加了颤振路径。
export PATH="/Users/me/dev/flutter/bin:$PATH"
经测试的颤振医生
$ flutter doctor -v
[✓] Flutter (Channel stable, 1.22.6, on macOS 11.2.1 20D75 darwin-x64, locale
en-US)
• Flutter version 1.22.6 at /Users/me/dev/flutter
• Framework revision 9b2d32b605 (5 weeks ago), 2021-01-22 14:36:39 -0800
• Engine revision 2f0af37152
• Dart version 2.10.5
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/me/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• 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.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin installed
• Dart plugin version 201.9317
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Community Edition (version 2020.3.2)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin installed
• Dart plugin version 203.6912
[✓] Connected device (1 available)
• iPhone 11 Pro (mobile) • 95B08A93-656C-42F9-AD8B-AF2325CFCAF2 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• No issues found!
/Users/me/dev/flutter/bin/flutter
/Users/me/dev/flutter/bin/dart
然后根据文档设置了Xcode。最后从命令行创建了flutter项目,然后flutter运行。
Launching lib/main.dart on iPhone 11 Pro in debug mode...
Running Xcode build...
└─Compiling, linking and signing... 4.2s
Xcode build done. 48.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: unable to spawn process
'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin' (Permission denied) (in target 'Runner' from project 'Runner')
warning: Could not read serialized diagnostics file: error("Failed to open
diagnostics file") (in target 'Runner' from project 'Runner')
error: unable to spawn process
'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin' (Permission denied) (in target 'Runner' from project 'Runner')
warning: Could not read serialized diagnostics file: error("Failed to open
diagnostics file") (in target 'Runner' from project 'Runner')
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
无法为模拟器构建应用程序。在 iPhone 11 Pro 上启动应用程序时出错。
对这个问题有什么想法吗?