Fix "cmdline-tools component is missing" and "Android license status unknown" (flutter doctor)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
✗ 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
- Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
- Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
The Android SDK Command-line Tools package, which provides sdkmanager, is missing, so Flutter can neither check nor accept the SDK licences. Install it from Android Studio (Settings > Android SDK > SDK Tools > Android SDK Command-line Tools), then run flutter doctor --android-licenses.
What this error means
flutter doctor inspects the Android SDK found through ANDROID_HOME or flutter config --android-sdk. To know the licence status and install components, it calls sdkmanager, which belongs to the cmdline-tools component and must live in <sdk>/cmdline-tools/latest/bin/. Android Studio does not always install this component by default, and the old tools/ folder is no longer used. Without it, Flutter prints "cmdline-tools component is missing" and, as a consequence, "Android license status unknown". Both lines usually go away together once the component is installed and the licences are accepted.
Common causes
- Component not installed: Android Studio installed the SDK, Platform-Tools and an emulator, but not "Android SDK Command-line Tools (latest)".
- Wrong folder layout: the tools archive was extracted into
cmdline-tools/instead ofcmdline-tools/latest/, sosdkmanageris not found. - Flutter looks at another SDK: several SDKs on the machine, or
flutter config --android-sdkpoints to an old folder. - Old
sdkmanagerwith a recent Java: the tool from the oldtools/binfolder crashes withNoClassDefFoundError: javax/xml/bindon Java 11+.
Step-by-step fix
-
See which SDK Flutter uses
The verbose output shows the Android SDK path and the Java in use. Default locations: macOS
~/Library/Android/sdk, Linux~/Android/Sdk, Windows%LOCALAPPDATA%\Android\Sdk.flutter doctor -v -
Install the Command-line Tools from Android Studio
Open Settings (macOS: Android Studio > Settings; Windows / Linux: File > Settings), type "Android SDK" in the search box, go to the SDK Tools tab, tick "Android SDK Command-line Tools (latest)", then Apply. From the welcome screen, the same panel opens with More Actions > SDK Manager.
-
Without Android Studio (macOS / Linux)
Download the "Command line tools only" archive from the Android Studio page of the Android Developers site, then put its content in
cmdline-tools/latest/: Flutter looks for that exact path.mkdir -p "$ANDROID_HOME/cmdline-tools" unzip commandlinetools-*_latest.zip -d "$ANDROID_HOME/cmdline-tools" mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/latest" "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "platform-tools" "platforms;android-35" "build-tools;35.0.0" -
Point Flutter to the right SDK
If
flutter doctor -vshows another folder, save the right path. On Windows (PowerShell), useflutter config --android-sdk "$env:LOCALAPPDATA\Android\Sdk".# macOS flutter config --android-sdk "$HOME/Library/Android/sdk" # Linux flutter config --android-sdk "$HOME/Android/Sdk" -
Accept the SDK licences
The command shows each Google licence to accept: read them, then answer
y. It is a legal agreement, not just a setting. If Java cannot be found, point to the Android Studio JDK withflutter config --jdk-dir <path>.flutter doctor --android-licenses -
Check
Run the diagnosis again: the Android toolchain line should turn into
[✓]. Open a new terminal if you just changedANDROID_HOME.flutter doctor
Did this fix work for you?
Confirm it in one click: it will rise for the next developers stuck on the same error.
Keep it from coming back
- When you install Android Studio, open the SDK Manager right away and tick the Command-line Tools in addition to Platform-Tools.
- Keep a single Android SDK on the machine and point
ANDROID_HOMEto it, so Flutter, Gradle and Android Studio all use the same one. - In CI, install
cmdline-tools;latestand accept the licences in the setup script (yes | sdkmanager --licenses), after reading them once.
Frequently asked questions
Is Android Studio required for Flutter?
No. The Command-line Tools, Platform-Tools, a platform and the Build-Tools are enough to build. Android Studio mostly makes installation and emulator management easier.
"Android sdkmanager not found" when I run flutter doctor --android-licenses?
Same problem: sdkmanager is missing from cmdline-tools/latest/bin. Install the component, then run the command again.
Can I ignore these two lines?
You can sometimes still run the app on an emulator, but Gradle will fail as soon as it needs to download a component whose licence is not accepted. Better fix them.
Useful tools for this error
More Mobile (Android, iOS) errors
- Fix "SDK location not found" (ANDROID_HOME / sdk.dir) on Android
- Fix "CocoaPods could not find compatible versions for pod" on iOS
- Fix "Unable to load script" (index.android.bundle) in React Native
- Fix "Signing for "App" requires a development team" in Xcode
- Fix "INSTALL_FAILED_UPDATE_INCOMPATIBLE: signatures do not match" on Android
- Fix "Duplicate class ... found in modules" in an Android Gradle build
- Fix "Invariant Violation: "main" has not been registered" (React Native / Expo)