1

Here is my Flutter doctor summary:


Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, v1.10.13-pre.12, on Microsoft Windows [Version 10.0.17134.1006], locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    X Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.
[√] Android Studio (version 3.5)
[√] Connected device (1 available)

! Doctor found issues in 1 category.

C:\Users\user>


  1. I have already updated My SDK manager to the latest version
  2. My SDK version is 29.0.2
  3. How can I resolve this error... This error appears even after updating SDK manager

Screenshot of SDK Location:

Screenshot of SDK Location

Nimantha
  • 6,405
  • 6
  • 28
  • 69
raman raman
  • 1,655
  • 4
  • 22
  • 34

11 Answers11

10

It works for me, Here are the steps that solve my problem:

STEP 1:ANDROID LICENSES --android-licenses, will resolve most cases

Since you are here you have reached "Android License Status Unknown" issue for Android tool chain, as many suggested try flutter doctor --android-licenses. If you are good with all the config. It should ask for an yes and press y and Voila. But if it shows:

Click image 1 here

Android sdkmanager tool not found (C\Users\__\local\Android\sdk\tools\bin\sdkmanager). Go to step two

STEP 2: SDK Manager installation from Android Studio

Open your Android Studio , File-> settings->System settings(left tab) ->Android SDK, go to SDK Tool section in that page, untick hide obsolete packages, select Android SDL tools(obsolete) and press apply.

Click image 2 here

It will install the SDK and you confirm it by going and checking if this path exists(C\Users\__\local\Android\sdk\tools\bin\sdkmanager)

STEP 3: Repeat 1

Repeat step 1 after installation in a new command line check if its working , else go to STEP 4

STEP 4: sdkmanager --update

It will ask you update the sdk, just run the command given in terminal C\Users\__\local\Android\sdk\tools\bin\sdkmanager --update. If it is running, then its cool. let it finish and repeat step 1, else if it is throwing some exceptions like java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema etc,

Click image 3 here

It means your java is not installed or not the correct version. Go to next step

STEP 5: JAVA 8.1 and JAVA_HOME path.

Install JAVA 8.1 and set JAVA_HOME path. Make sure it is version 8.1(register free account and download from oracle the 8.1 version, remember above 11+ wont work for Flutter

Click image 4 here

NOTE: by yaniv maymon: if you already have Java installed on your computer and the sdkmanager --update still not working. go the environment variable and update the "JAVA_HOME" path to jdk folder. then exit the command prompt, open it again and run the update command –

STEP 6: Final Step

After installing and setting up path properly, run the C\Users\__\local\Android\sdk\tools\bin\sdkmanager --update command in new terminal and it will work

STEP 7: Rerun flutter doctor, You can see it saying to run the command flutter doctor --android-licenses . so run flutter doctor --android-licenses in terminal and press y when asked

Resources

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Bauroziq
  • 951
  • 9
  • 14
1

It could be that your path is not set correctly? Have you looked in Settings>Appearance and Behavior>System Settings>Android SDK>Android SDK Location?

Code Poet
  • 6,222
  • 2
  • 29
  • 50
1

I had the same problem and solve it installing the latest java version Java 8. Then setting JAVA_HOME Variable. In Windows: Environment Variables> System Variables> add a new or edit your JAVA_HOME> in the Variable Value field, enter your JDK or JRE installation path the JAVA_HOME. After this, the command flutter doctor --android-licenses worked.

0

According to this issue in the flutter repository it seems like you have not accepted all the SDK license agreements.

You can resolve it by running

flutter doctor --android-licenses

in you terminal and accepting the outstanding licenses by pressing y and return.

Hannes Küttner
  • 908
  • 7
  • 9
  • this is the output:--- C:\Users\user>flutter doctor --android-licenses A newer version of the Android SDK is required. To update, run: C:\Users\user\AppData\Local\Android\Sdk\tools\bin\sdkmanager --update C:\Users\user>flutter doctor --android-licenses A newer version of the Android SDK is required. To update, run: C:\Users\user\AppData\Local\Android\Sdk\tools\bin\sdkmanager --update C:\Users\user>C:\Users\user\AppData\Local\Android\Sdk\tools\bin\sdkmanager --update Exception in thread "main" java.lang.NoClassDefFoundError: – raman raman Oct 08 '19 at 02:43
  • 1
    That seems very similar to the issues others are describing in the issue thread. Could you try their solutions and see if any of them fixes your problem? It seems maybe pointing your JAVA_HOME to the JRE installed with Android Studio might help. Since I cannot reproduce your error I am wildly guessing here. – Hannes Küttner Oct 08 '19 at 04:58
  • Why SDK component Set up says An existing SDK was detected.System will only download missing or outdated SDK components – raman raman Oct 08 '19 at 10:40
0

I had the same problem

You can resolve this issue by running this command

flutter doctor --android-licenses

into your flutter_console.bat

Or

uninstall the android studio and reinstall it, it will fix the issue.

Kashif Bhatti
  • 1
  • 1
  • 1
  • 1
0

Add env variable ANDROID_SDK_ROOT as the path where the sdk was installed to.

A Jar of Clay
  • 5,622
  • 6
  • 25
  • 39
0

This solved the problem for me:

  1. open Android Studio and open SDK Manager then SDK Tools tab. check the box "Android SDK Command-line Tools
    enter image description here

  2. Open the command prompt and type flutter doctor --android-licenses then press enter

  3. It is going to ask you to type 'Y' for each license. type 'y' until all the licenses are done.

  4. now check with flutter doctor again in the command prompt and it should tell you that license is accepted.

Rayees AC
  • 4,426
  • 3
  • 8
  • 31
devsadek
  • 1
  • 2
0
  • Open Android Studio and open SDK Manager then SDK Tools tab.
  • Check the box Android SDK Command-line Tools
General Grievance
  • 4,555
  • 31
  • 31
  • 45
0

What worked for me was to delete the Android 30 file in the following directory:

C:\Users\user\AppData\Local\Android\Sdk\platform

After that, I went to File > Settings > System Settings > SDK platforms.

Then I checked the Android 11.0® option, and finally clicked Apply.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
0

Installing Android SDK command line tools in SDKs tools on Android studio worked for me

Eyayu Tefera
  • 771
  • 9
  • 9
-1

After installing Android SDK command line tools in the tools SDKs of Android Studio, execute the command flutter doctor --android-licenses