flutter doctor --android-licenses gives a java error
Installing Android SDK Command-line tools from Android SDK Manager did the job for me.
- Open Tools > SDK Manager
- From the left choose, Appearance & Behavior > System Settings > Android SDK
- Select SDK Tools from the top menu
- Check Android SDK Command-line tools and click 'apply'.
Alternative to step #1: WINDOWS: File > Settings (Ctrl+Alt+S) / MAC : Android Studio > Preferences
If you are facing a problem in spite of the above steps, you can try upgrading your system to JDK 8. Official documentation of upgrading to JDK 8 is available here.
The following answer
can completely solve this issue onWindows
, Linux
& Mac OS X
with ONLY 3 steps.
Step 1. How do I recognize the issue?
At the first, this is what I met for the issue
$ flutter doctor -v
And the following command is not work for my situation.
$ flutter doctor --android-licenses
The way to solve this is to install
Android SDK Command-line Tools. And how?
You just need to do it by the following two steps.
Step 2. How do I solve the issue?
Install: Android SDK Command-line Tools
Step 1. Open SDK Manager
Top Menu -> Tools -> SDK Manager
Step 2. Install command-line tools
- Unfold Appearance & Behavior
- Unfold System Settings
- Click Android SDK
- Click tab of SDK Tools
- Check Android SDK Command-line Tools (latest)
- Click Apply button.Then click the OK button to finish the installation.
Keep going to sign android licenses.
After Android Studio finishing install, you can do the following.
$ flutter doctor --android-licenses
After saying yes many times, all android licenses have been signed.
Step 3. How do I verify the issue has been solved?
Check it by flutter doctor again.
You can see thatAll Android licenses accepted.
It means the issue was been solved.
Congratulations, you have completed this task!
i had the same problem, solved it by installing the coomand-line tools from android studio
click on file, settings then on the search bar type sdk and click in android sdk
Then click on sdk tools, check the android command-line tools box, the click on apply allow to download. then try running flutter doctor --android-licenses
again on your cmd you will be prompted to accept licenses