Flutter doctor results with “cmdline-tools component is missing”

We Are Going To Discuss About Flutter doctor results with “cmdline-tools component is missing”. So lets Start this Java Article.

Flutter doctor results with “cmdline-tools component is missing”

  1. Flutter doctor results with “cmdline-tools component is missing”

    if anything above didn't worked out make sure you have set the proper JDK/JRE locations in environment variables in system settings of windows:
    Add below path in your System environment path variable for user variable as well as your system variable:

  2. cmdline-tools component is missing”

    if anything above didn't worked out make sure you have set the proper JDK/JRE locations in environment variables in system settings of windows:
    Add below path in your System environment path variable for user variable as well as your system variable:

Solution 1

You can follow below steps in order to ensure proper working of your flutter project:
your sdk manager should look something like this:

enter image description here

1. Installing Android SDK Command-line Tools in Android Studio:

Preferences > Appearance & Behavior > System Settings > Android SDK > SDK Tools >

install these 3 tools:

Android SDK Command-line Tools (latest)

Android SDK Build Tools 31

Android SDK Platform tools (latest version 31)

and make sure every tools must be of same latest version in order to avoid any error as there might be new updates later on.

2. Also make sure to Accept Android Licences by running below command in your cmd:

flutter doctor --android-licenses

if anything above didn’t worked out make sure you have set the proper JDK/JRE locations in environment variables in system settings of windows:

Add below path in your System environment path variable for user variable as well as your system variable:

 C:\Program Files\Java\jdkXXXXX\bin 

here XXX is your version and this should be added in your sys var and user both

C:\Users\Neha\AppData\Local\Android\Sdk\tools
C:\Users\Neha\AppData\Local\Android\Sdk\build-tools
C:\Users\Neha\AppData\Local\Android\Sdk\platform-tools

the above three paths should be added in your user variable path
check two screenshots attached below for proper path settings.
I have added android studio’s tools path also so do that as I have done in screenshot.

This one is for user variable path:

enter image description here

This one is for system variable path:

enter image description here

Follow source to learn more about setting the path for java:

Original Author Abhishek Vishwakarma Of This Content

Solution 2

In the screen you’ve shown, just use “Android Studio default JDK” (or any other JDK 11).

Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK.

You’d also need to setup the same path as JAVA_HOME environmental variable, as well as ANDROID_HOME. In Windows, these can be added below Settings > Advanced System Settings > Environmental Variables. Flutter needs these set up to find the CLI tools …
and the problem might not be the CLI tools themselves, but that it doesn’t know about the Java SDK or Android SDK at all.

Original Author Martin Zeitler Of This Content

Solution 3

You have to manually install java on your PC but install the JRE(Java Runtime Environment) not the JDK (Java Development Kit).
The JRE comes packed with all you’ll need for flutter.

I think the one AS comes with is the JDK not the JRE

Original Author Denzel Of This Content

Solution 4

If you are installing Flutter without Android Studio.
Run this command in your Android/bin folder directory where you have your sdkmanager.bat file.
In my case its C:\Android\bin>.
type this command

sdkmanager.bat --install "cmdline-tools;latest --sdk_root=../

This worked for me and I hope it will work for you too.

Original Author Vicky Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment