Skip to content
FR
  1. LuzineDebug
  2. Mobile (Android, iOS)
  3. [!] Android toolchain - develop for Android devi…
Mobile (Android, iOS) Beginner ≈ 10 min to fix

Fix "cmdline-tools component is missing" and "Android license status unknown" (flutter doctor)

Error message
[!] 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
In short

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.

Be the first to confirm this fix

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

  1. Component not installed: Android Studio installed the SDK, Platform-Tools and an emulator, but not "Android SDK Command-line Tools (latest)".
  2. Wrong folder layout: the tools archive was extracted into cmdline-tools/ instead of cmdline-tools/latest/, so sdkmanager is not found.
  3. Flutter looks at another SDK: several SDKs on the machine, or flutter config --android-sdk points to an old folder.
  4. Old sdkmanager with a recent Java: the tool from the old tools/bin folder crashes with NoClassDefFoundError: javax/xml/bind on Java 11+.

Step-by-step fix

  1. 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.

    bash
    flutter doctor -v
  2. 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.

  3. 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.

    bash
    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"
  4. Point Flutter to the right SDK

    If flutter doctor -v shows another folder, save the right path. On Windows (PowerShell), use flutter config --android-sdk "$env:LOCALAPPDATA\Android\Sdk".

    bash
    # macOS
    flutter config --android-sdk "$HOME/Library/Android/sdk"
    # Linux
    flutter config --android-sdk "$HOME/Android/Sdk"
  5. 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 with flutter config --jdk-dir <path>.

    bash
    flutter doctor --android-licenses
  6. Check

    Run the diagnosis again: the Android toolchain line should turn into [✓]. Open a new terminal if you just changed ANDROID_HOME.

    bash
    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_HOME to it, so Flutter, Gradle and Android Studio all use the same one.
  • In CI, install cmdline-tools;latest and 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

All Mobile (Android, iOS) errors →