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:
- How do I correctly install the
cmdline-tools
? Is there a specific path I should use forsdkmanager
? - 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
How to install
cmdline-tools
Tools
>SDK Manager
SDK Tools
tabAndroid SDK Command-Line Tools (latest)
How to accept SDK Licenses
flutter doctor --android-licenses
And last check again
flutter doctor
.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:
Locate the SDK Manager:
Replace
<path-to-your-Android-SDK>
with the actual path to your SDK folder. It’s usually in:C:Users<YourUsername>AppDataLocalAndroidSdk
Install the
cmdline-tools
:cmdline-tools
using the SDK Manager:Verify Installation:
After installation, you should see the
cmdline-tools
folder under your SDK path (sdk/cmdline-tools
). You can now runflutter 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:
Run the License Command:
Follow the Prompts:
y
to accept each license.Recheck with
flutter doctor
:flutter doctor
again:Additional Notes:
Ensure
<path-to-sdk>
is the path where your SDK is installed.