30

I was following a tutorial to install an android emulator, without android studio, and I was told to run the command- flutter doctor. Upon running this, I got this error-

X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.

So I tried running flutter doctor --android-licenses, and I got this error-

Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to
resolve this.

This is my ANDROID_HOME directory-

enter image description here

And Inside platforms, I have android-32 installed.

I saw some fixes for this, but those were all with android studio. How do I fix this? Thanks in advance!

Air Admirer
  • 598
  • 2
  • 5
  • 16

8 Answers8

35
  1. Open Android Studio
  2. Open Preferences
  3. Appearances tab on the left
  4. System Settings
  5. Android SDKenter image description here
  6. Click Show Package details
  7. Toggle SDK Tools
  8. Apply and restart Android Studio
  9. Run flutter doctor
ArvinT
  • 435
  • 4
  • 11
32

If you're using the command line tool without android studio been installed todevelop mobile app here's a way around this issue I was able to resolve it.

enter image description here

First check if there are packages to be updated

sdkmanager --list

if there are then run the command below ensure you've good internet connection and power

sdkmanager --update

Next run

sdkmanager --install "cmdline-tools;latest"

Next run the command below and the error will not be there again.

flutter doctor --android-licenses

flutter doctor 

and you're good to go!!! enter image description here

32

If you are using Android Studio:

  1. Open Android Studio
  2. Goto File -> Settings -> Appearance & Behavior -> System Settings -> Android SDK (Screenshot attached below)

screenshot
3. Update/Install Android Studio Command-line Tools.
4. Click apply and restart android studio.

Kunchok Tashi
  • 2,413
  • 1
  • 22
  • 30
6
  1. Open the Android Studio. Then click on the New Options. There you can see a dropdown to navigate into SDK manager.

  2. In the system settings open the Android SDK, then open the SDK Tool Kit options. Then check the Android SDK command-line Tools(latest)

  3. Restart the Android Studio and run the command

    flutter doctor --android-licenses
    
Preet Sangha
  • 64,563
  • 18
  • 145
  • 216
pavan_illa
  • 61
  • 2
4

Open Android Studio, Tools Menu, SDK Manager. In the window that comes up there are inner panels, choose SDK Tools panel. Tick Android SDK Command-line Tools. Choose Apply button near the bottom of the window.

4

When you download the Android SDK command line tools from https://developer.android.com/studio#span-idcommand-toolsa-namecmdline-toolsacommand-line-tools-onlyspan, your folder structure will look something like this:

AndroidSDK/
    cmdline-tools/
        bin/
        lib/
        NOTICE.txt
        source.properties

It needs to be moved to

AndroidSDK/
    cmdline-tools/
        **latest/**
            bin/
            lib/
            NOTICE.txt
            source.properties

You already have the sdkmanager/cmdline-tools - you've already used it to download the platform tools etc. You just need to have it in the correct folder.

Once it's in the correct spot, your licenses message should change from:

X Android license status unknown.

when you run flutter doctor, to:

! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

(I had already accepted a license when installing the platform tools)

divillysausages
  • 7,883
  • 3
  • 25
  • 39
  • Thank you, @divillysausages! Wow, that was confusing. Out of dozens of posts (mostly outdated), only your 0-upvote gem on Stack Overflow has the actual answer. The zip extracts to the folder "cmdline-tools", so after renaming it to "latest" and putting it inside another "cmdline-tools" within the sdk, sdkmanager is working! – Patrick Horn Nov 16 '22 at 18:46
  • This Soultion works perfect in my case. Thank you – Mohammed Shalan Dec 22 '22 at 02:18
3

juste install "Android SDK Command-line Tools" on android studio enter image description here and than run again "flutter doctor --android-licenses"
enter image description here

2

I think you need to install cmdLine

please run flutter doctor and share cmd results to help better