androidiosflutterwindowsmobile

Flutter Setup: Android Toolchain Issues - cmdline-tools Missing and License Status Unknown


I'm currently setting up Flutter for Android development, but I'm running into some issues with the Android toolchain. When I run flutter doctor, I get the following warnings:

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/windows-android-setup for more details.

I tried to follow the steps, but I'm still having trouble figuring out:

  1. How do I correctly install the cmdline-tools? Is there a specific path I should use for sdkmanager?
  2. How do I resolve the "Android license status unknown" issue? I tried running flutter doctor --android-licenses but got no clear response.

Any help or guidance on how to fix this would be greatly appreciated!

Thanks in advance!


Solution

  • How to install cmdline-tools

    1. Open android studio
    2. At the menu select Tools > SDK Manager
    3. Then go to SDK Tools tab
    4. Find and check Android SDK Command-Line Tools (latest)

    Android SDK Command-Line Tools

    1. Then click apply and ok

    How to accept SDK Licenses

    1. Open cmd/terminal
    2. Run flutter doctor --android-licenses
    3. Then accept all licenses

    And last check again flutter doctor.