问题:
flutter doctor
运行命令 flutter doctor
报错:
Android toolchain - develop for Android devices (Android SDK version 30.0.2) ✗ cmdline-tools component is missing Run `path/to/sdkmanager --install "cmdline-tools;latest"` See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
一般这个命令操作我们用不到,但是就是看着这个错误提示不爽,所以给它解决掉。
解决:
可以到Android Studio
中配置 SDK Tools
, 勾选 Android SDK Command-line Tools (latest)
下载完成后:
再执行 flutter doctor
命令:
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
按照提示执行命令:
flutter doctor --android-licenses
一直输入 y
最后:
再执行 flutter doctor
命令,结果 • No issues found!
一切正常了: