flutter doctor shows one of these under Android toolchain. They are the exact messages from the Flutter tool:
✗ cmdline-tools component is missing.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
✗ Unable to locate Android SDK.
They often appear together, and the order of the fixes matters: the license command needs the command-line tools, and both need the SDK.
1. “Unable to locate Android SDK”
Flutter can’t find the SDK folder. If Android Studio is installed and has downloaded an SDK, tell Flutter where it is:
flutter config --android-sdk "C:\Users\you\AppData\Local\Android\Sdk" # Windows
flutter config --android-sdk ~/Library/Android/sdk # macOS
flutter config --android-sdk ~/Android/Sdk # Linux
These are Android Studio’s default locations. The real path is shown in Android Studio under Settings → Languages & Frameworks → Android SDK → Android SDK Location. If there’s no SDK yet, open Android Studio once; its setup wizard downloads it.
2. “cmdline-tools component is missing”
The SDK is there, but without the command-line tools that sdkmanager (and the license command) live in. In Android Studio:
- Settings → Languages & Frameworks → Android SDK, then the SDK Tools tab.
- Tick Android SDK Command-line Tools (latest).
- Click Apply and wait for the download.
Without Android Studio, download “Command line tools only” from developer.android.com/studio and unzip it so the path ends in <sdk>/cmdline-tools/latest/bin. Then set the ANDROID_HOME environment variable to the SDK folder, as Flutter’s message suggests.
3. “Android license status unknown” or “licenses not accepted”
Accept the licenses from the terminal:
flutter doctor --android-licenses
It lists each license and asks Accept? (y/N). Type y and Enter for every one, then run flutter doctor again.
If the command itself fails, it’s almost always one of two things:
- The command-line tools are missing. Do step 2 first.
- Java isn’t found or is the wrong version. The license check runs Java. Run
flutter doctor -vand look for theJava binary at:line. If it’s missing or very old, point Flutter at a JDK 17 or newer withflutter config --jdk-dir "<path to JDK>". The JDK bundled with Android Studio works. Version mismatches between Java and Gradle are covered in “Unsupported class file major version”.
Check it worked
flutter doctor
You want a green tick on Android toolchain with a line like “All Android licenses accepted.” If Android Studio itself still shows a warning, that’s a separate check and doesn’t stop you building Android apps.
Once the toolchain is green, the next problems usually come from the project rather than your machine: Kotlin version errors, “Namespace not specified” and the yearly target API rule.
Frequently asked questions
How do I fix "Android license status unknown"?
Install the Android SDK Command-line Tools from Android Studio’s SDK Manager (SDK Tools tab), then run flutter doctor –android-licenses and accept every license with y. If the command fails, check that Java is found with flutter doctor -v.
Where is the Android SDK on my computer?
By default in C:\Users\you\AppData\Local\Android\Sdk on Windows, ~/Library/Android/sdk on macOS and ~/Android/Sdk on Linux. Android Studio shows the exact path under Settings, Languages and Frameworks, Android SDK.
Do I need Android Studio to build Flutter Android apps?
No. You need the Android SDK, its command-line tools and a JDK. Android Studio is the easiest way to install and update them, but you can install the command-line tools on their own and use any editor.
Stuck on a build or a store release? I fix and maintain Flutter apps, or tell me about your project. More fixes: all Flutter answers.