225

I have been going around in circles with this issue, there are so many people who have issues similar to mine, but not one of them is the same. I am trying to get flutter fully set up, but can't resolve one of the issues.

When I run flutter doctor -v I get the following output:

[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18362.657], locale en-GB)
    • Flutter version 1.12.13+hotfix.8 at C:\flutter
    • Framework revision 0b8abb4724 (3 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\%username%\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    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.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 43.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] VS Code (version 1.42.1)
    • VS Code at C:\Users\%username%\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.8.1

[√] Connected device (1 available)
    • AOSP on IA Emulator • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

! Doctor found issues in 1 category.

And if I try to run the command flutter doctor --android-licenses I get:

Android sdkmanager tool not found (C:\Users%username%\AppData\Local\Android\Sdk\tools\bin\sdkmanager). Try re-installing or updating your Android SDK, visit https://flutter.dev/setup/#android-setup for detailed instructions.

And it's right, there is no "tools" folder in my SDK folder. How on earth do I fix that? I have installed all the SDK tools, even the NDK (not that flutter picks that up) I have tried creating a tools folder and copying sdkManager.bat (including the bin folder) from build-tools, but that just tells me to update my SDK manager, which when attempted just fails.

It looks like everything still works, it just makes me a little uncomfortable having that issue there.

Any help is much appreciated.

Hamed
  • 5,867
  • 4
  • 32
  • 56
Mark Perry
  • 2,908
  • 3
  • 18
  • 27
  • i have same problem but change sdk path worked for me , i have android sdk path first is in D drive where my sdk reside D:\sdk\sdk but it is always giving error but when i changed my path from this to C:\Users\rocky\AppData\Local\Android\Sdk and it worked prefectly now , and make sure there is a folder present with the name cmdline-tools – Sunil Chaudhary Jun 20 '22 at 05:48

12 Answers12

713

I have just hit the same issue - my resolution was a little simpler:

Just like you, I have Android Studio installed, the key is to install Android SDK Command-line Tools, steps being:

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

At that point, you will be prompted to accept the SDK license and the command line tools will be installed. Your license issue should now be resolved.

FYI, the command line tools will add a new folder cmdline-tools inside your SDK Folder. If you look in there cmdline-tools/latest/bin you will see sdkmanager - but your license issue should already be resolved.

Stx
  • 7,146
  • 1
  • 5
  • 2
  • 12
    This should be the correct answer. Asking people to downgrade is not an actual solution in this case IF it can work with the latest version of Android Studio. – Cozzbie Jul 15 '20 at 15:11
  • This resolve the issue on Android Studio 4.0, too. Thanks! – lilbyrdie Sep 11 '20 at 19:52
  • 5
    This is the best answer. If after going through the above process you still encounter any errors, configure your android sdk by typing the following commands in your terminal: 'flutter config --android-sdk '. Locate your android sdk path and replace it in the command. Please type the command without the quotes. – John Jun 07 '21 at 15:49
  • 5
    In OSX, the `sdkmanager` is located under `/Users/[username]/Library/Android/sdk/cmdline-tools/latest/bin` – Prabowo Murti Sep 14 '21 at 09:39
  • 3
    @john 'flutter config --android-sdk ' works for me, Thanks ! – Gitesh Oct 13 '21 at 15:34
  • Works for me in Jan '22 on Windows. Only had to run Flutter Doctor again, nothing else. – shapeshifter42 Jan 15 '22 at 20:02
  • After this I run "flutter doctor --android-licenses" – Amir Hosseinzadeh Mar 09 '22 at 08:55
  • big thx to you! you save my life! i've never seen output of flutter doctor command without issues! – WiRight Mar 16 '22 at 18:17
  • I can't find the `SDK Tools` panel... It is not there within the `Tools` section. Also, I have already installed the command line tools into the `cmdline-tools` folder manually, but I still get the error as there is no folder just called `tools`. What do I do now?! – Lecdi Apr 03 '22 at 09:08
  • 1
    This solution assumes everyone uses Android Studio – Mizile Jun 21 '22 at 13:23
  • This is the right answer. I find it mind-boggling that Android SDK developers didn't ensure that such installations happened automatically. – Nav Jul 08 '23 at 04:31
133

Android toolchain - develop for Android devices X cmdline-tools component is missing Run path/to/sdkmanager --install "cmdline-tools;latest"

This error means your "Android SDK Command-line Tools are missing"

  1. Open Android Studio
  2. In the Menu bar , click Tools(4th last)
  3. choose SDK Tools panel
  4. Tick Android SDK Command-line Tools
  5. Click Apply at bottom of the window

IT WILL START DOWNLOADING the missing component

enter image description here

Boken
  • 4,825
  • 10
  • 32
  • 42
logify
  • 1,497
  • 1
  • 6
  • 7
  • 4
    These options (to check Command-line Tools and get it downloaded) is located in another place in my version of Android Studio (Arctic Fox, 2020.3.1 Patch 3): Android Studio Menu > Preferences > Appearance & Behavior > System Settings > Android SDK > SDK Tools (tab). Then check Android SDK Command-line Tools (latest) and get it downloaded. – Écio Silva Nov 24 '21 at 23:14
61

Go to settings:

go to settings..

Go to the Android SDK:

go to android sdk

Uncheck the command-line tools:

uncheck the command-line tools

Check Show details and uncheck the Android command-line tools and then click on Apply then click OK.

check the show details and uncheck the android command-line tools and then click on apply then click ok

Download this package from https://developer.android.com/studio and extract it. Then go to your android sdk location (C:\Users\Pooja\AppData\Local\Android\Sdk) and paste it with the name tools.

Then close and restart Android Studio and check for updates. After installing updates, close Android Studio.

Open the command line and enter:

flutter doctor --android-licenses

And, finally, press y for accept.

now enter (Flutter doctor),don't include parenthesis.

All we be solved.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Pooja Patil
  • 621
  • 5
  • 2
46

Open sdk manager from here

enter image description here

Navigate to the panel titled "SDK Tools"

Then, select **Android Sdk Command-line Tools
Note: If it's already checked then follow the process

  • Uncheck
  • Apply
  • Re-check
  • Apply

enter image description here

Albert Renshaw
  • 17,282
  • 18
  • 107
  • 195
Rasel Khan
  • 2,976
  • 19
  • 25
20

It's almost 2022, and things seem changed a little bit.

I had my SDK installed on a separate folder and command-line tools were missing. even though I downloaded and extracted it into the SDK folder this error was still there. took me sometime to figure it out.

  • make sure to have correct sdk path. use this if needed flutter config --android-sdk <path-to-your-android-sdk-path>
  • download latest command-line tools from developer.android.com
  • extract downloaded file's content into the SDK folder and make sure it has the following structure
<sdk folder>/cmdline-tools/latest/`
 |- bin
 |- lib
 |- ...

Alternatively, use the following command from any directory of command-line tools you have: <cmdline-tools folder>\bin\sdkmanager --install "cmdline-tools;latest" --sdk_root=<sdk folder>

this may however need you to have relatively new sdkmanager to do the job. so it may not give you expected result if it is too old.


PS: it is not working if the content is under <sdk folder>/tools, <sdk folder>/cmdline-tools or <sdk folder>/cmdline-tools/tools

Yılmaz Durmaz
  • 2,374
  • 12
  • 26
12

From https://flutter.dev/docs/get-started/install/windows :

Warning: In Android Studio 3.6 or later, you need to manually add the old version of the Android SDK Tools for Flutter to work. To do this:

  • Open the Android Studio SDK Manager

  • In the Android SDK tab, uncheck Hide Obsolete Packages

  • Check Android SDK Tools (Obsolete)

...

This is a known issue that will be addressed in an upcoming version of Flutter.

Community
  • 1
  • 1
neutromancer
  • 185
  • 9
4
  1. Scroll down and Download Command line tools from https://developer.android.com/studio#downloads
  2. Put your Downloaded file (tools) in C:\Users\ABC\AppData\ABC\Android\Sdk
  3. Close Android Studio, open Android Studio and check update.
  4. Open command line and paste flutter doctor --android-licenses
  5. Press y to accept
  6. Run flutter doctor and you should be good.
Nato Boram
  • 4,083
  • 6
  • 28
  • 58
  • 1
    only this way saved me. thank you. but the downloaded file should placed in (Local\Android\Sdk\cmdline-tools\latest). – navid Feb 02 '21 at 06:47
1

No need to uninstall android studio what you need to do is just go to the andriod studio app go to android sdk and install cmdline toolkit then close the app and type flutter doctor you will get it installed

1

Run 'flutter config --android-'flutter config --android-sdk <path-to/android/sdk>sdk <path-to/android/sdk>

1

If you have sdkmanager in the env, you can run the command:

sdkmanager --install "cmdline-tools;latest"

If it is not defined as an environment variable, you can go to the sdkmanager folder and run it there. It would be something like this below:

/home/User/path-Android/cmdline-tools/bin/sdkmanager --install "cmdline-tools;latest"

And then just run flutter's doctor again.

Javad
  • 5,755
  • 4
  • 41
  • 51
0

I encounter the same issue as yours. What I do is to (at least for now...):

  1. uninstall Android Studio 3.6 or 3.6.1
  2. delete the whole Android SDK directory at C:\Users{your_user_name}\AppData\Local\Android\Sdk
  3. install Android Studio 3.5.3. You can find it here(https://developer.android.com/studio/archive) Run the studio again. Do not import the setting of 3.6, and delete them when prompted.
  4. go through the Android Studio "Welcome Wizard" again, use standard option.
  5. after the installation, you will see that the "tools" folder exists.
  6. you will need to install the plugins for dart and flutter again in "Configure"-->"SDK Manager"-->"plugins" within in Android Studio.
terence ng
  • 55
  • 3
  • On MacOs, installing Android Studio 3.6 or above creates a new path to sdkmanager that is not recognized by flutter. When you get to sdk folder, there is a new cmdline-tools folder and inside it you can find bin folder. But flutter was looking for "sdk/tools/bin". Downgrading to Android Studio 3.5.3 solved the problem. Thanks terence. – Alexandre Mucci Mar 04 '20 at 13:40
  • Recommend using the top rated answer and not this one. – lilbyrdie Sep 11 '20 at 19:51
  • Solution by Stx could be a better way to resolve this – Javier Gomez Mar 30 '21 at 18:45
0

I have noticed when running android studio from commandline:

Observed package id 'build-tools;32.0.0-rc1' in inconsistent location '/home/kobi/Android/Sdk/build-tools/32.0.0-rc1-2' (Expected '/home/kobi/Android/Sdk/build-tools/32.0.0-rc1')

after I changed the export path in ~/.bashrc, flutter doctor was able to recognize and said all is ok. (though had to accept licenses)

kobi7
  • 969
  • 1
  • 7
  • 15