skip to Main Content

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!

2

Answers


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

    Login or Signup to reply.
  2. To resolve the issues you’re facing with the Android toolchain setup for Flutter, follow these steps:

    1. Install Android Command-Line Tools (cmdline-tools)

    You need to install the missing cmdline-tools component for the Android SDK. Here’s how to do it:

    Steps:

    1. Locate the SDK Manager:

      • If you have Android Studio installed, the SDK Manager can be found inside the Android SDK folder. Navigate to:
        <path-to-your-Android-SDK>/tools/bin
        

        Replace <path-to-your-Android-SDK> with the actual path to your SDK folder. It’s usually in:

        • : C:Users<YourUsername>AppDataLocalAndroidSdk
    2. Install the cmdline-tools:

      • Run the following command to install the cmdline-tools using the SDK Manager:
        ./sdkmanager --install "cmdline-tools;latest"
        
    3. Verify Installation:
      After installation, you should see the cmdline-tools folder under your SDK path (sdk/cmdline-tools). You can now run flutter doctor again to check if the error is resolved.

    2. Resolve Android License Status Unknown

    After installing the required tools, you also need to accept the Android SDK licenses to proceed.

    Steps:

    1. Run the License Command:

      • Open a terminal and run the following command to accept all the licenses:
        flutter doctor --android-licenses
        
    2. Follow the Prompts:

      • The command will prompt you to accept various licenses. Press y to accept each license.
    3. Recheck with flutter doctor:

      • After accepting the licenses, run flutter doctor again:
        flutter doctor
        
      • The Android toolchain should now show no issues if all licenses are accepted.

    Additional Notes:

    • Android Studio SDK Location: If you use Android Studio, make sure Flutter is pointing to the correct SDK location. To verify this, run:
      flutter config --android-sdk <path-to-sdk>
      

      Ensure <path-to-sdk> is the path where your SDK is installed.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search