How to Fix “Unable to Locate Android SDK” in Flutter (2026 Update)

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.

New to Flutter setup? If you haven’t installed Flutter at all yet, start with our complete Flutter setup guide — this article assumes Flutter itself is already installed and you’re troubleshooting the Android toolchain.

Table of Contents


1. What the Error Actually Means

The full error message from flutter doctor typically looks like one of these:

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.

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.

💡 Read the path line: If 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:

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
⚠️ Don’t guess the path — confirm it. The most common mistake is copying the Android Studio application folder instead of the Android SDK folder. These are different locations. The SDK folder contains subfolders named platform-tools, build-tools, and platforms. If you don’t see those, you have the wrong folder.

Verify the path contains the right folders:


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.

After running this, verify Flutter accepted it:

💡 This setting persists. 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):

Fix via command line (if you prefer terminal):

⚠️ Don’t have sdkmanager yet? If you can’t find 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.

You’ll be prompted to accept several licenses one by one. Type y and press Enter for each:

Then run flutter doctor again — the Android toolchain section should now be green:


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:

Windows — set via System Environment Variables:

🚨 Always open a new terminal after changing environment variables. The old terminal session won’t see the new values — this is the #1 reason people think the fix didn’t work when it actually did.

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.


10. Quick Copy-Paste Cheat Sheet

Run these in order. Most setups are fully resolved by the end of this block:


11. Common Beginner Mistakes

Mistake 1: Pointing to the Android Studio app folder instead of the SDK folder

Mistake 2: Not opening a new terminal after changing environment variables

Mistake 3: Assuming Android Studio installation = Android SDK installation

Mistake 4: Skipping flutter doctor -v and guessing the fix


12. FAQ

Q: What causes “Unable to locate Android SDK” in Flutter?

Answer: Most commonly it means one of three things: the Android SDK was never downloaded (Android Studio was installed but the first-launch SDK setup was skipped), the SDK was installed to a non-default folder and Flutter doesn’t know where it is, or the 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?

Answer: Open Android Studio → Settings → Android SDK, copy the path shown in “Android SDK Location”, then run 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?

Answer: You don’t need Android Studio to run Flutter apps — VS Code with the Flutter extension works fine. However, Android Studio is the easiest way to install and manage the Android SDK, especially for beginners. Once the SDK is installed you can use any editor you prefer.

Q: What is “cmdline-tools component is missing” and why does Flutter need it?

Answer: The Android SDK Command-line Tools package contains 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?

Answer: This usually means your system has multiple Java versions installed and the wrong one is active. Flutter’s Android toolchain works best with the JDK bundled inside Android Studio. Point Flutter to it with 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?

Answer: It depends on the warning. A [!] 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
Show 1 Comment

1 Comment

Leave a Reply