flutter doctor --android-licenses gives a java error flutter doctor --android-licenses gives a java error java java

flutter doctor --android-licenses gives a java error


Installing Android SDK Command-line tools from Android SDK Manager did the job for me.

  1. Open Tools > SDK Manager
  2. From the left choose, Appearance & Behavior > System Settings > Android SDK
  3. Select SDK Tools from the top menu
  4. Check Android SDK Command-line tools and click 'apply'.

Alternative to step #1: WINDOWS: File > Settings (Ctrl+Alt+S) / MAC : Android Studio > Preferences


enter image description here

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 on
Windows, 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 -venter image description here

And the following command is not work for my situation.
$ flutter doctor --android-licensesenter image description here

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 Managerenter image description here

Step 2. Install command-line tools

  1. Unfold Appearance & Behavior
  2. Unfold System Settings
  3. Click Android SDK
  4. Click tab of SDK Tools
  5. Check Android SDK Command-line Tools (latest)
  6. Click Apply button.enter image description hereThen 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
enter image description hereAfter 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.

$ flutter doctor -v
enter image description here

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 sdkAndroid 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