Flutter says it can’t find your Android SDK. Here’s exactly how to fix it.
You ran flutter doctor, expecting a row of green checkmarks, and instead got: “Unable to locate Android SDK.” This is one of the most common Flutter setup errors — and it’s almost always fixable in under five minutes once you know what’s actually wrong.
The error doesn’t always mean the Android SDK is missing entirely. It can mean Flutter is looking in the wrong folder, or that the SDK is present but the Android command-line tools component was never installed. This guide covers every cause and every fix, with copy-paste commands for Windows, macOS, and Linux.
Table of Contents
1. What the Error Actually Means
The full error message from flutter doctor typically looks like one of these:
# Variant A — SDK not found at all
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
# Variant B — SDK found, but command-line tools missing
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
# Variant C — Licenses not accepted
[!] Android toolchain - develop for Android devices
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
| Variant | What it means | Jump to fix |
|---|---|---|
| “Unable to locate Android SDK” | SDK not installed, or Flutter is looking in the wrong folder | Steps 2–3 |
| “cmdline-tools component is missing” | SDK folder exists but Android command-line tools aren’t installed | Step 4 |
| “Android license status unknown” | SDK is present but licenses haven’t been accepted yet | Step 5 |
2. All the Causes at a Glance
| # | Cause | How common |
|---|---|---|
| 1 | Android Studio installed but SDK was never downloaded on first launch | Very common |
| 2 | SDK installed to a custom or non-default folder | Common |
| 3 | SDK exists but Android SDK Command-line Tools component missing | Very common |
| 4 | ANDROID_HOME environment variable not set or pointing to wrong path |
Common |
| 5 | Terminal session is stale — hasn’t picked up new path values yet | Common |
| 6 | Android SDK licenses not accepted | Moderate |
| 7 | Wrong Java / JDK version conflicts with SDK tooling | Less common |
3. Step 1 — Run flutter doctor -v First
Always start here. The -v (verbose) flag gives you the full detail you need to diagnose the exact cause rather than guessing.
flutter doctor -v
Look specifically at the Android toolchain section. You’ll see one of the variants shown in Section 1. The exact wording tells you which fix to apply — don’t skip this step and jump straight to fixes, because the wrong fix wastes time.
# Example verbose output — Android toolchain section
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/yourname/Library/Android/sdk ← SDK path Flutter found
✗ cmdline-tools component is missing ← this is the actual problem
• Android SDK Build-tools 34.0.0
• ANDROID_HOME = /Users/yourname/Library/Android/sdk
• No issues found with the adb binary
✗ Android license status unknown.
flutter doctor -v shows • Android SDK at /some/path, Flutter has found your SDK — the problem is something else (usually missing cmdline-tools or unaccepted licenses). If there is no path line at all, Flutter truly cannot find the SDK and you need Steps 2–3.
4. Step 2 — Find Your Android SDK Path
The most reliable way to find your correct SDK path is through Android Studio’s SDK Manager — it shows you exactly where the SDK is installed regardless of your OS.
In Android Studio:
Android Studio → Settings (or Preferences on macOS)
→ Appearance & Behavior
→ System Settings
→ Android SDK
→ "Android SDK Location" field at the top ← copy this path
Default SDK paths by OS (if you used a standard installation):
| Operating system | Default Android SDK path |
|---|---|
| Windows | C:UsersYourNameAppDataLocalAndroidSdk |
| macOS | /Users/yourname/Library/Android/sdk |
| Linux | /home/yourname/Android/Sdk |
platform-tools, build-tools, and platforms. If you don’t see those, you have the wrong folder.
Verify the path contains the right folders:
# macOS / Linux — list the contents of your SDK folder
ls ~/Library/Android/sdk # macOS default
ls ~/Android/Sdk # Linux default
# You should see folders like:
# build-tools cmdline-tools emulator licenses platform-tools platforms
# Windows (PowerShell)
dir "$env:LOCALAPPDATAAndroidSdk"
5. Step 3 — Point Flutter to the SDK
Once you have the correct path, give it directly to Flutter. This is the single most reliable fix for the “Unable to locate Android SDK” error.
# macOS / Linux — replace with your actual SDK path
flutter config --android-sdk ~/Library/Android/sdk
# Linux
flutter config --android-sdk ~/Android/Sdk
# Windows (Command Prompt)
flutter config --android-sdk "C:UsersYourNameAppDataLocalAndroidSdk"
# Windows (PowerShell)
flutter config --android-sdk "$env:LOCALAPPDATAAndroidSdk"
After running this, verify Flutter accepted it:
flutter doctor -v
# Android toolchain section should now show:
# • Android SDK at /your/path ← confirms Flutter found it
flutter config --android-sdk saves the path to Flutter’s global config file — you only need to run it once per machine. Future flutter doctor runs will always check this location first.
6. Step 4 — Install Missing Command-line Tools
If flutter doctor shows “cmdline-tools component is missing” even after pointing to the correct SDK path, the Android SDK Command-line Tools package was never installed. Flutter requires it for license checks, SDK management, and builds.
Fix via Android Studio SDK Manager (easiest):
Android Studio
→ Settings → Appearance & Behavior → System Settings → Android SDK
→ SDK Tools tab
→ Check: Android SDK Command-line Tools (latest)
→ Check: Android SDK Build-Tools
→ Check: Android SDK Platform-Tools
→ Click Apply → OK
Fix via command line (if you prefer terminal):
# macOS / Linux — navigate to your SDK folder's cmdline-tools bin
cd ~/Library/Android/sdk/cmdline-tools/latest/bin # macOS
cd ~/Android/Sdk/cmdline-tools/latest/bin # Linux
# Install the missing components
./sdkmanager --install "cmdline-tools;latest"
./sdkmanager --install "build-tools;34.0.0"
./sdkmanager --install "platform-tools"
./sdkmanager --install "platforms;android-34"
# Windows (PowerShell — from SDK folder)
cd "$env:LOCALAPPDATAAndroidSdkcmdline-toolslatestbin"
.sdkmanager.bat --install "cmdline-tools;latest"
.sdkmanager.bat --install "build-tools;34.0.0"
.sdkmanager.bat --install "platform-tools"
sdkmanager in your SDK folder, it means the command-line tools are genuinely not installed — use the Android Studio SDK Manager UI method above first to bootstrap the installation, then the terminal method works for future updates.
7. Step 5 — Accept Android Licenses
Even after the SDK and cmdline-tools are correctly installed, Flutter won’t pass the Android toolchain check until you accept Google’s Android SDK licenses. This is a one-time step per machine.
flutter doctor --android-licenses
You’ll be prompted to accept several licenses one by one. Type y and press Enter for each:
# Expected output — accept each license:
Review licenses that have not been accepted (y/N)? y
1/7: License android-googletv-license:
---------------------------------------
...license text...
Accept? (y/N): y
2/7: License android-sdk-license:
...
Accept? (y/N): y
# Continue until all licenses accepted
All SDK package licenses accepted.
Then run flutter doctor again — the Android toolchain section should now be green:
flutter doctor
# Target output:
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
8. Step 6 — Set ANDROID_HOME Environment Variables
If flutter config --android-sdk worked but you’re still seeing issues in some contexts (CI pipelines, certain IDEs, or after system restarts), set ANDROID_HOME as a permanent environment variable so every tool on your system knows where the SDK lives.
macOS / Linux — add to your shell profile:
# Open your shell profile in a text editor
# For zsh (default on macOS): ~/.zshrc
# For bash: ~/.bashrc or ~/.bash_profile
nano ~/.zshrc # or use: code ~/.zshrc (VS Code)
# Add these lines at the bottom:
export ANDROID_HOME=$HOME/Library/Android/sdk # macOS
# export ANDROID_HOME=$HOME/Android/Sdk # Linux (use this instead)
export PATH=$ANDROID_HOME/emulator:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$PATH
# Save and apply without restarting terminal:
source ~/.zshrc
Windows — set via System Environment Variables:
# Option A: PowerShell (temporary — current session only)
$env:ANDROID_HOME = "$env:LOCALAPPDATAAndroidSdk"
$env:PATH += ";$env:ANDROID_HOMEplatform-tools;$env:ANDROID_HOMEcmdline-toolslatestbin"
# Option B: Permanent (via GUI)
# Search Windows → "Edit the system environment variables"
# → Environment Variables → New under System Variables:
# Variable name: ANDROID_HOME
# Variable value: C:UsersYourNameAppDataLocalAndroidSdk
#
# Then edit PATH and add:
# %ANDROID_HOME%platform-tools
# %ANDROID_HOME%cmdline-toolslatestbin
9. Bonus: Fixing Java / JDK Version Errors
If flutter doctor --android-licenses fails with a Java error like Could not determine java version or Unsupported class file major version, you have a JDK version conflict. Flutter’s Android toolchain works best with the JDK bundled inside Android Studio.
# Check which Java Flutter is currently using
flutter doctor -v | grep -i java
# or
java -version
# Tell Flutter to use Android Studio's bundled JDK instead of your system JDK
# macOS
flutter config --jdk-dir "/Applications/Android Studio.app/Contents/jbr/Contents/Home"
# Linux (Android Studio installed in ~/android-studio)
flutter config --jdk-dir ~/android-studio/jbr
# Windows (adjust path to match your Android Studio installation)
flutter config --jdk-dir "C:Program FilesAndroidAndroid Studiojbr"
# Verify the change
flutter doctor -v | grep -i java
10. Quick Copy-Paste Cheat Sheet
Run these in order. Most setups are fully resolved by the end of this block:
# ── macOS cheat sheet ──────────────────────────────────────────
# 1. Check what flutter doctor actually says
flutter doctor -v
# 2. Point Flutter to your SDK (update path to match your username)
flutter config --android-sdk ~/Library/Android/sdk
# 3. Accept all Android licenses
flutter doctor --android-licenses
# 4. Final check — should be all green
flutter doctor
# ── Linux cheat sheet ──────────────────────────────────────────
flutter doctor -v
flutter config --android-sdk ~/Android/Sdk
flutter doctor --android-licenses
flutter doctor
# ── Windows (Command Prompt) cheat sheet ───────────────────────
flutter doctor -v
flutter config --android-sdk "C:UsersYourNameAppDataLocalAndroidSdk"
flutter doctor --android-licenses
flutter doctor
11. Common Beginner Mistakes
Mistake 1: Pointing to the Android Studio app folder instead of the SDK folder
# ❌ WRONG — this is the Android Studio IDE application
flutter config --android-sdk "/Applications/Android Studio.app"
# ✅ CORRECT — this is the actual Android SDK
flutter config --android-sdk ~/Library/Android/sdk
# Quick check: the correct folder should contain these subfolders:
# build-tools/ platform-tools/ platforms/ cmdline-tools/
Mistake 2: Not opening a new terminal after changing environment variables
# ❌ WRONG — editing .zshrc then immediately running flutter doctor
# in the same terminal session — the old PATH values are still active
# ✅ CORRECT — after editing your shell profile, either:
source ~/.zshrc # reload in the same terminal
# OR open a completely new terminal window before running flutter doctor
Mistake 3: Assuming Android Studio installation = Android SDK installation
# ❌ Wrong assumption:
# "I installed Android Studio, so the Android SDK is installed"
# Android Studio is the IDE. The Android SDK is a separate download
# that Android Studio offers during its first-launch setup wizard.
# If you skipped or cancelled that wizard, the SDK was never downloaded.
# ✅ FIX: Open Android Studio → complete the Setup Wizard
# OR: Settings → Android SDK → Download SDK
Mistake 4: Skipping flutter doctor -v and guessing the fix
# ❌ Running flutter doctor (no -v) and assuming the problem
flutter doctor
# [!] Android toolchain ← vague, doesn't tell you which sub-problem
# ✅ Run with -v first — it tells you exactly what's wrong
flutter doctor -v
# [!] Android toolchain
# ✗ cmdline-tools component is missing ← now you know exactly what to fix
12. FAQ
Q: What causes “Unable to locate Android SDK” in Flutter?
ANDROID_HOME environment variable is missing or wrong. Run flutter doctor -v to find out which.
Q: What is the quickest single fix to try first?
flutter config --android-sdk <that-path> in your terminal. This resolves the error in most cases without needing to touch environment variables.
Q: Do I need Android Studio, or can I use the SDK without it?
Q: What is “cmdline-tools component is missing” and why does Flutter need it?
sdkmanager, avdmanager, and other tools Flutter uses for license management, device management, and Android builds. Flutter’s doctor check specifically looks for this component — without it, the Android toolchain check fails even if the rest of the SDK is correctly installed. Fix it through Android Studio SDK Manager → SDK Tools tab → Android SDK Command-line Tools (latest).
Q: Why does flutter doctor –android-licenses fail with a Java error?
flutter config --jdk-dir "/Applications/Android Studio.app/Contents/jbr/Contents/Home" (adjust path for your OS), then retry flutter doctor --android-licenses.
Q: I fixed everything but flutter doctor still shows a warning — is that OK?
[!] next to “Chrome” or “VS Code” won’t block Android development. A [✗] next to “Android toolchain” will prevent Android builds. As a beginner, you need at minimum: Flutter, Android toolchain, and one connected device or emulator all showing green. Other warnings can be addressed later.
Next Steps After Flutter Doctor is Green
Once your Android toolchain is working, you’re ready to start building. Here’s where to go next:
| Article | What you’ll learn |
|---|---|
| Flutter Tutorial for Beginners: From Install to First App | Complete setup walkthrough — running your first Flutter app |
| Flutter Widgets: Stateless vs Stateful Explained | The most important Flutter concept — start here after setup |
| Build a Notes App in Flutter — Part 1 | First real project — layouts, navigation, and state management |

Pingback: Top 10 Flutter Build Errors Beginners See (and How to Fix Them)