When executing flutter doctor, an error is reported that the command line tool of Android Studio is not installed & and android-licenses do not agree
Among them, the error statement is such as the title: path/to/sdkmanager --install "cmdline-tools;latest" and the like, because there are too many logs when agreeing to the terms, so the error report is covered. There is no screenshot.
Solution:
1. Open Android Studio -- Tools -- SDK Manager
2、选中Android SDK --> SDK Tools --> Android SDK Command-line Tools(latest) --> Apply
After the application will Confirm Change--> OK and then install the command line tool
3. Execute in the terminal at this time
flutter doctor --android-licenses
- Just enter y for all the terms, because you have agreed before, so it is displayed as follows.
flutter doctor --android-licenses
[=======================================] 100% Computing updates...
All SDK package licenses accepted.
4. Execute flutter doctor again,
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.
The warning is because dart is installed through brew, so leave it alone for now.