in

How to Fix “Flutter Toolchain – Develop for Android Devices (Unable to Locate Android SDK)” on Windows 11

Flutter Toolchain
Flutter Toolchain

Set up a fresh Flutter install on a new machine last month and hit this immediately — ran flutter doctor, and there it was: Unable to locate Android SDK, even though I could see the SDK folder sitting right there on disk. Turns out “the SDK exists” and “Flutter can find the SDK” are two completely different problems, and this error almost never means what people assume it means.

Quick Answer

  • This error means Flutter can’t locate a valid Android SDK installation, which is usually an environment variable problem, not a missing-SDK problem.
  • Run flutter doctor -v first for the full detail, since the summary version often hides the actual path Flutter is checking.
  • If you installed the SDK manually (not through Android Studio), the folder structure needs to specifically be cmdline-tools/latest/, not just cmdline-tools/.
  • Setting ANDROID_HOME or ANDROID_SDK_ROOT incorrectly is the single most common cause on Windows.
  • flutter config --android-sdk <path> is often faster and more reliable than fighting with environment variables.

Why It Happens

So the confusing part about this error is that it doesn’t necessarily mean the SDK isn’t installed — a lot of people hit this with the SDK sitting right there on disk, fully installed, and Flutter still can’t see it. There are a handful of specific reasons for that gap.

Environment variable not set, or set to the wrong path. Flutter looks for the Android SDK primarily through ANDROID_HOME (older, still widely used) or ANDROID_SDK_ROOT (the name Google has been pushing toward). If neither is set, or if it’s set but points somewhere the SDK actually isn’t — say, you moved the SDK folder after setting the variable — you get this exact error.

Command-line tools installed with the wrong folder structure. If you installed just the Android SDK Command Line Tools (without full Android Studio), Google’s documented structure requires the tools to sit inside a cmdline-tools/latest/ subfolder specifically — not directly inside cmdline-tools/, and not in a version-numbered folder like cmdline-tools/11.0/. Flutter’s SDK detection logic checks for that exact latest folder name, and if your structure doesn’t match, detection fails even though everything else about the install is fine.

SDK installed to a custom or non-default location. The default Android Studio installer puts the SDK somewhere predictable, but if you customized the install path — especially common if you’re trying to avoid filling up your C: drive — Flutter needs to be told explicitly where to look rather than guessing.

No valid Android SDK platforms installed. So even when Flutter finds the SDK folder itself, it also checks for at least one valid platform version inside platforms/. If that folder’s empty or only contains an outdated platform version, you’ll get a related but distinct error about “no valid Android SDK platforms found,” which looks similar but needs a different fix.

Deprecated ANDROID_HOME conflicting with a newer ANDROID_SDK_ROOT. If you’ve got both variables set to different paths — which happens more often than you’d think after following mismatched tutorials from different years — Flutter can end up confused about which one to trust.

An overlooked cause worth mentioning: antivirus or Windows Defender quarantining part of the SDK during install. It’s not common, but a security tool flagging and removing files from inside the SDK folder during setup can leave you with a partial install that looks complete in File Explorer but is actually missing pieces Flutter needs.

Step-by-Step Fixes

Step 1: Run flutter doctor -v for full detail

flutter doctor -v

The -v flag shows the exact path Flutter is checking and what it found (or didn’t) there — this is worth doing before changing anything, since it tells you whether the problem is “no path set” versus “wrong path set” versus “path set correctly but structure is wrong.”

Step 2: Set ANDROID_HOME (or ANDROID_SDK_ROOT) correctly

  1. Search for “Environment Variables” in the Windows 11 Start menu and open “Edit the system environment variables.”
  2. Click Environment Variables.
  3. Under System variables (not just User variables), click New.
  4. Set the variable name to ANDROID_HOME and the value to your actual SDK path — typically something like C:\Users\YourName\AppData\Local\Android\Sdk if installed through Android Studio’s defaults.
  5. Click OK, then open a new Command Prompt (existing ones won’t pick up the change) and run flutter doctor again.

And if you’re not sure of your exact SDK path, open Android Studio, go to Settings > Languages & Frameworks > Android SDK, and the path is listed right at the top.

Step 3: Use flutter config as a faster alternative

Instead of wrestling with environment variables, you can point Flutter directly at the SDK:

flutter config --android-sdk "C:\Users\YourName\AppData\Local\Android\Sdk"

This sets Flutter’s own internal config rather than relying on the system environment variable, and it tends to be more reliable, especially if you’ve got multiple SDK installs floating around from different tools.

Step 4: Fix the command-line tools folder structure

If you installed Command Line Tools Only rather than full Android Studio, check your folder layout. It needs to be:

android-sdk/
  cmdline-tools/
    latest/
      bin/
      lib/
      ...

Not cmdline-tools/bin/ directly, and not cmdline-tools/11.0/. If your download extracted into the wrong structure, create a latest folder inside cmdline-tools and move the contents there manually.

Step 5: Install a valid SDK platform

If Flutter finds the SDK but reports no valid platforms, run:

sdkmanager "platforms;android-34"

Adjust the version number as needed — replace it with whatever level your target devices need. You can run this from inside the SDK’s cmdline-tools\latest\bin folder if sdkmanager isn’t on your PATH directly.

Step 6: Accept Android licenses

flutter doctor --android-licenses

This is a separate, commonly missed step — even with a correctly detected SDK, unaccepted licenses will still block a clean flutter doctor pass. Accept each one with y when prompted.

What Actually Worked For Me

I’d installed the Command Line Tools package directly rather than going through full Android Studio, since I didn’t need the IDE for the project I was setting up. Set ANDROID_HOME right away, pointed it at the folder, and flutter doctor still came back with the exact same “unable to locate” error, which was confusing since the path was clearly correct.

Took a bit of digging through GitHub issues to realize the actual problem was the folder structure — I’d extracted the command-line tools zip directly into cmdline-tools, not into a cmdline-tools/latest subfolder like Flutter specifically expects. Created the latest folder, moved everything into it, reopened my terminal, and flutter doctor picked it up immediately. Kind of an easy miss since nothing in the download itself tells you that folder name matters this much.

Advanced Fixes and Edge Cases

Multiple Flutter or SDK installs conflicting on PATH. If you’ve got more than one Flutter SDK on your system — say, one from a manual download and another installed through a version manager like FVM — check where flutter and where dart in Command Prompt to confirm which installation is actually being used, since PATH order determines which one wins, and it might not be the one you think.

Corrupted SDK manager cache. If sdkmanager commands are failing silently or hanging, clearing %LOCALAPPDATA%\Android\Sdk\.temp (backup first if unsure) and retrying can resolve cache-related install failures that don’t show clear error messages.

Windows Defender or antivirus exclusions. If installs keep silently losing files, add your Android SDK folder and your Flutter SDK folder to Windows Security’s exclusion list under Virus & threat protection settings, to rule out real-time scanning interfering with file writes during SDK operations.

Check for a leftover ANDROID_SDK_ROOT pointing somewhere stale. Run echo %ANDROID_SDK_ROOT% and echo %ANDROID_HOME% in Command Prompt separately — if they show different paths, that mismatch itself can be the entire problem, even if one of them is technically correct.

Prevention Tips

  • Stick to one method of installing the Android SDK (either full Android Studio or Command Line Tools Only) rather than mixing both across different attempts, to avoid ending up with scattered, conflicting installs.
  • Set environment variables at the System level, not just User level, especially if you’ll be running Flutter commands from different terminal contexts (VS Code’s integrated terminal, standalone Command Prompt, PowerShell).
  • After any SDK path change, always open a completely new terminal window — existing sessions won’t pick up updated environment variables.
  • Run flutter doctor right after any SDK-related change, rather than assuming it worked and finding out three steps later.

FAQ

Do I need Android Studio installed, or can I use command-line tools only? Command-line tools only works fine for Flutter development if you’re using VS Code or another editor — Android Studio isn’t required, just the SDK components themselves.

Why does flutter doctor sometimes show a checkmark for Android Studio but still fail on Android toolchain? These are checked separately — Android Studio being installed doesn’t guarantee its bundled SDK is the one Flutter is actually configured to use, especially if you’ve set an environment variable pointing elsewhere.

Does this issue happen the same way on Windows 10? Yes, the underlying cause and fixes are identical — this isn’t a Windows 11-specific bug, just commonly encountered on fresh Windows 11 setups since that’s what most new machines ship with now.

Is ANDROID_HOME or ANDROID_SDK_ROOT the “correct” one to use? ANDROID_SDK_ROOT is the more current name going forward, but ANDROID_HOME still works and is what most existing tutorials reference — using either consistently is more important than which specific one you pick.

Editor’s Opinion

the folder structure thing genuinely got me, nothing in the sdk download itself warns you that “latest” is a magic folder name flutter specifically looks for. if your path looks right and it’s still not detecting anything, check that before you start messing with environment variables again.

Written by ugur

Ugur is an editor and writer at (NSF Tech), specializing in technology and Windows. He produces in-depth, well-researched, and reliable stories with a strong focus on Windows, emerging technologies, digital culture, cybersecurity, AI developments, and innovative solutions shaping the future. His work aims to inform, inspire, and engage readers worldwide with accurate reporting and a clear editorial voice.

Contact: [email protected]