flutter doctor says the Android cmdline-tools component is missing
cmdline-tools component is missing.Short answer
Flutter checks for a cmdline-tools folder inside the Android SDK it found, and stops the Android checks when that folder is absent. Install Android SDK Command-line Tools (latest), make sure Flutter reads the same SDK folder, then run flutter doctor --android-licenses. If the licenses still show as unknown, look at where sdkmanager sits, which Java runs it, and how old your Flutter is.
Fix it fast
1Find out which cause you have
Run doctor in verbose mode and read the Android toolchain block. It prints the SDK folder Flutter picked, the Java binary it will hand to sdkmanager, and then the first check that failed. Those three lines decide which cause below is yours.
flutter doctor -v2Match what you see, then jump to its fix
- 1
cmdline-tools component is missing. (the SDK path above it is the one you expect)The Command-line Tools package was never installedFix - 2
The 'Android SDK at' line points somewhere other than the folder Android Studio managesFlutter reads a different SDK folder from the one you updatedFix - 3
No 'component is missing' line, but 'Android license status unknown' or 'Android sdkmanager not found'The tools are unpacked one folder too deepFix - 4
Android licenses not accepted, or Some Android licenses not acceptedThe licenses have not been accepted on this machineFix - 5
Android sdkmanager tool was found, but failed to run, or a java.lang.UnsupportedClassVersionError in doctor -vsdkmanager fails because of the Java it is givenFix - 6
Android license status unknown, even after you accepted every licenseYour Flutter release cannot read newer sdkmanager outputFix
- 1
What does the error look like?
cmdline-tools component is missing.Android license status unknown.Run `flutter doctor --android-licenses` to accept the SDK licenses.Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
Cause 1 of 6
The Command-line Tools package was never installed
1Check
Flutter only tests whether a folder called cmdline-tools exists in the SDK root. A fresh Android Studio setup, or an SDK copied from another machine, often has platform-tools and build-tools but not this package. Set SDK to the path doctor printed and list it.
SDK="$HOME/Library/Android/sdk" # use the path flutter doctor -v printed
ls "$SDK"
ls "$SDK/cmdline-tools" 2>/dev/null || echo "no cmdline-tools folder"2Fix
In Android Studio open Tools > SDK Manager, switch to the SDK Tools tab, tick Android SDK Command-line Tools (latest) and apply. On a build server without Android Studio, download the command line tools zip from the Android Studio download page and unpack it so the files end up in cmdline-tools/latest.
mkdir -p "$SDK/cmdline-tools"
unzip ~/Downloads/commandlinetools-*.zip -d "$SDK/cmdline-tools"
mv "$SDK/cmdline-tools/cmdline-tools" "$SDK/cmdline-tools/latest"3Verify
sdkmanager runs from the expected place and doctor moves on to the license check.
"$SDK/cmdline-tools/latest/bin/sdkmanager" --version
flutter doctorCause 2 of 6
Flutter reads a different SDK folder from the one you updated
1Check
Flutter picks the SDK in this order: a path saved with flutter config --android-sdk, then ANDROID_HOME, then ANDROID_SDK_ROOT, then the default folder (~/Library/Android/sdk on macOS, ~/Android/Sdk on Linux, %LOCALAPPDATA%\Android\sdk on Windows). An old saved path wins over everything else, so you can install the tools and still see the error.
flutter config --list
echo "ANDROID_HOME=$ANDROID_HOME"
echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"2Fix
Point Flutter at the folder that has the tools, and export the same path for Gradle and your shell. To drop a stale saved path instead, set it to an empty string.
flutter config --android-sdk "$HOME/Library/Android/sdk"
# or remove a saved path so ANDROID_HOME is used:
flutter config --android-sdk ""
# ~/.zshrc or ~/.bashrc
export ANDROID_HOME="$HOME/Library/Android/sdk"3Verify
Open a new terminal; doctor now reports the folder you set.
flutter doctor -v | grep -A2 'Android toolchain'Cause 3 of 6
The tools are unpacked one folder too deep
1Check
The folder test passes as soon as cmdline-tools exists, but Flutter only runs sdkmanager from cmdline-tools/latest/bin or from a folder named like a version number. Unzipping straight into cmdline-tools leaves it at cmdline-tools/cmdline-tools/bin, where Flutter never looks.
find "$SDK/cmdline-tools" -maxdepth 3 -name 'sdkmanager*'2Fix
Rename the inner folder to latest, or remove it and reinstall the package from Android Studio, which uses the right layout.
mv "$SDK/cmdline-tools/cmdline-tools" "$SDK/cmdline-tools/latest"3Verify
The find command now prints a path ending in cmdline-tools/latest/bin/sdkmanager.
"$SDK/cmdline-tools/latest/bin/sdkmanager" --versionCause 4 of 6
The licenses have not been accepted on this machine
1Check
Accepted licenses are stored as small files in the SDK's licenses folder. A new SDK, a new CI image or an SDK copied without that folder has none, and Gradle also refuses to download missing SDK parts until they exist.
ls -la "$SDK/licenses"2Fix
Run the license prompt and answer y to each one. In CI, pipe the answers in so the job does not hang waiting for input.
flutter doctor --android-licenses
# non-interactive, for CI images:
yes | flutter doctor --android-licenses3Verify
Doctor shows 'All Android licenses accepted.' under the Android toolchain.
flutter doctorCause 5 of 6
sdkmanager fails because of the Java it is given
1Check
sdkmanager is a Java program, and Flutter launches it with the JDK shown on the 'Java binary at' line: one saved with flutter config --jdk-dir, otherwise the one bundled with Android Studio, then JAVA_HOME, then java on the PATH. On a machine without Android Studio an old JDK in JAVA_HOME is the usual culprit; with an outdated Android Studio, its bundled JDK can be the old one. Flutter itself warns when Java is older than 17.
flutter doctor -v | grep -i -A2 "java binary"
echo "JAVA_HOME=$JAVA_HOME"2Fix
Point Flutter at a current JDK. Android Studio's bundled runtime is the safest choice because it matches the SDK tools it ships with.
# macOS path of Android Studio's bundled JDK
flutter config --jdk-dir="/Applications/Android Studio.app/Contents/jbr/Contents/Home"3Verify
The Java line in doctor -v shows the new path and the license check returns a real answer.
flutter doctor -vCause 6 of 6
Your Flutter release cannot read newer sdkmanager output
1Check
Android now marks sdkmanager as deprecated in favour of the Android CLI, and newer Command-line Tools changed what sdkmanager --licenses prints. Flutter versions released before that change look for the old wording, find nothing, and report unknown. If running the tool yourself prints a note that the --licenses option is no longer needed, this is your case.
flutter --version
"$SDK/cmdline-tools/latest/bin/sdkmanager" --licenses2Fix
Upgrade Flutter. Current stable falls back to reading the licenses folder when sdkmanager no longer reports a status.
flutter upgrade3Verify
Doctor's Android toolchain line turns green without any other change.
flutter doctorHow do I stop it coming back?
- Install SDK packages from Android Studio's SDK Manager, or script them with exact package names, instead of unzipping by hand on each machine.
- Set ANDROID_HOME once in your shell profile and avoid saving a second path with flutter config unless you need it.
- Bake the licenses folder and the Command-line Tools into CI images, and run flutter doctor -v as the first CI step so a broken SDK fails fast.
- Upgrade Flutter and the Command-line Tools together; a new SDK tool with an old Flutter is where the 'unknown' status comes from.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
Related fixes
Mobile apps
Flutter Android build stops with Execution failed for task ':app:…'
Execution failed for task ':app:compileFlutterBuildRelease'.
The line only tells you which Gradle step broke; the task name in the quotes tells you why.
5 causes, each with a fixMobile apps
A phone is plugged in over USB but Android Studio and adb do not list it
adb devices prints List of devices attached with nothing below it
adb lists a phone only when four things hold: USB debugging is on, you accepted the computer's RSA key on the phone, the computer has a driver or udev rule for the device, and the cable carries data to a running adb server.
6 causes, each with a fixMobile apps
Flutter's Android build stops: JAVA_HOME is not set
ERROR: JAVA_HOME is set to an invalid directory
The Gradle wrapper script needs a Java runtime and looks in two places: the JAVA_HOME variable, then a java command on PATH.
3 causes, each with a fixMobile apps
flutter run hangs for minutes on Running Gradle task 'assembleDebug'
Downloading https://services.gradle.org/distributions/gradle-8.14-all.zip
That line only says Gradle started; the wait is inside Gradle.
3 causes, each with a fixMobile apps
flutter doctor cannot find the Java that comes with Android Studio
Unable to find bundled Java version.
Flutter looks for the Java inside Android Studio first, then JAVA_HOME, then any java on PATH.
3 causes, each with a fixMobile apps
flutter doctor cannot find the Android SDK
Unable to locate an Android SDK.
Flutter looks for the SDK in a fixed order: its own android-sdk setting, then ANDROID_HOME, then ANDROID_SDK_ROOT, then the default folder for your system.
4 causes, each with a fix