执行flutter doctor时、报错Android Studio的命令行工具没有安装& 以及 android-licenses没有同意
其中提示错误语句如标题: path/to/sdkmanager --install "cmdline-tools;latest"之类的, 因为同意条款的时候,日志太多,所以把报错覆盖了.没有截图.
解决方法:
1、打开Android Studio -- Tools -- SDK Manager
2、选中Android SDK --> SDK Tools --> Android SDK Command-line Tools(latest) --> Apply
应用之后会Confirm Change--> OK 之后安装命令行工具
3、这个时候再在终端执行
flutter doctor --android-licenses
- 所有条款全输入 y 就行, 因为之前同意过了,所以显示如下.
flutter doctor --android-licenses
[=======================================] 100% Computing updates...
All SDK package licenses accepted.
4、再执行flutter doctor、
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.7.12, on macOS 12.6.3 21G419 darwin-x64, locale zh-Hans-CN)
! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/2.19.6/libexec/bin/dart, which is
not inside your current Flutter SDK checkout at /Users/holothurian/opt/flutter. Consider adding
/Users/holothurian/opt/flutter/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.77.3)
[✓] Connected device (4 available)
! Error: iPhone is busy: Fetching debug symbols for iPhone. Xcode will continue when iPhone is
finished. (code -10)
[✓] HTTP Host Availability
! Doctor found issues in 1 category.
警告是因为通过brew安装了dart、暂时先不管.