Fix Guide

Android Studio Error "Please Select Android SDK": How to Fix It

RS
Raiyan Shahid Building ExamAI, FileForge, CodeCompiler & Party Rush under BrynFlow · Get in touch

Quick fix: "Please select Android SDK" means Android Studio cannot find a valid SDK for your project. Most of the time a Gradle sync fixes it: choose File > Sync Project with Gradle Files. If the error stays, open Settings > Languages & Frameworks > Android SDK, make sure Android SDK Location points to a real folder, and check that sdk.dir in local.properties matches it (steps 2 and 3).

Type "android studio error" into Google and the first suggestion is "please select android sdk". The message appears in the run configuration dialog, or as a red warning when you press Run, usually right after you clone a project, open someone else's project, switch computers or upgrade Android Studio. Its cousin in the Build window says:

SDK location not found. Define a valid SDK location with an ANDROID_HOME
environment variable or by setting the sdk.dir path in your project's local
properties file.

Both errors have the same root problem, and the fixes below solve both. They are ordered from quickest and safest to most involved. Rerun the app after each step.

Why "Please select Android SDK" happens

To build an app, Android Studio needs three things to line up: the SDK folder on your computer, the path the project uses to find it, and an installed SDK platform that matches the compileSdk in your build file. The error appears when one of them is off:

How to fix the Please select Android SDK error

  1. Sync the project with Gradle files. Choose File > Sync Project with Gradle Files, or click the elephant Sync icon in the toolbar. Wait for the Build window to say the sync finished, then press Run again. This alone clears the error in many Stack Overflow reports.
  2. Check the Android SDK location in Settings. Open File > Settings (Windows and Linux) or Android Studio > Settings (macOS) and go to Languages & Frameworks > Android SDK. Older versions list it under Appearance & Behavior > System Settings > Android SDK. The Android SDK Location field must point to a folder that exists. The default locations are:
    Windows: C:\Users\<you>\AppData\Local\Android\Sdk
    macOS:   /Users/<you>/Library/Android/sdk
    Linux:   /home/<you>/Android/Sdk
    Click Edit, pick the folder, apply the change and sync again.
  3. Fix sdk.dir in local.properties. Open local.properties in the project root. The sdk.dir line must point to the same SDK folder:
    # Windows (backslashes and the colon are escaped)
    sdk.dir=C\:\\Users\\you\\AppData\\Local\\Android\\Sdk
    # macOS
    sdk.dir=/Users/you/Library/Android/sdk
    A path from another machine is a very common cause after cloning a repo. Correct it, or delete the line and let Android Studio write it on the next sync. This file is machine-specific, so keep it in .gitignore. On a CI server or the command line, set the ANDROID_HOME environment variable instead.
  4. Install the SDK platform your project compiles against. Look up compileSdk in your module's build.gradle.kts (or build.gradle), then open Tools > SDK Manager. On the SDK Platforms tab, install that API level. On the SDK Tools tab, make sure Android SDK Build-Tools and Android SDK Platform-Tools are installed. Click Apply, then sync.
  5. Set the module SDK in Project Structure. For imported projects and Flutter projects, open File > Project Structure. Check the SDK under Project and under Modules; if a module shows no SDK or one marked as missing, choose an installed Android API platform from the drop-down, click Apply and restart Android Studio. Flutter users should also run:
    flutter config --android-sdk "/path/to/Android/Sdk"
    flutter doctor -v
  6. Invalidate caches and restart. Choose File > Invalidate Caches, then click Invalidate and Restart. Android Studio rebuilds its indexes and project model, which helps when the settings look right but the error will not go away.
  7. Re-import the project as a last resort. Close the project, back up and then delete the .idea folder in the project root, and open the project again with File > Open. Android Studio regenerates its project files from Gradle. You may need to set up run configurations again if they were stored only in .idea.

If nothing works

Run ./gradlew assembleDebug (or gradlew assembleDebug on Windows) from the project folder. If the command-line build fails with "SDK location not found", the problem is the path (steps 2 and 3). If it builds but Android Studio still complains, the problem is the IDE's project model (steps 5 to 7). You can also update Android Studio with Help > Check for Updates and follow Google's guide to reporting Android Studio bugs to search for or file your exact message.

Once the app builds, you might hit the next common error, "No target device found". Our no target device fix guide covers it. Flutter users who see "Gradle task assembleDebug failed" can follow the assembleDebug fix guide. New to Android? Start the free Android with Kotlin track.

Frequently asked questions

What does Please select Android SDK mean in Android Studio?

It means the run configuration or module has no valid Android SDK attached, so Android Studio cannot build or run the app. The SDK path may be wrong, the SDK platform may be missing, or the project has not been synced.

Where is the Android SDK installed by default?

Android Studio installs it in %LOCALAPPDATA%\Android\Sdk on Windows, ~/Library/Android/sdk on macOS and ~/Android/Sdk on Linux, unless you chose a different folder during setup.

How do I fix SDK location not found in Gradle?

Gradle needs the SDK path from sdk.dir in local.properties or from the ANDROID_HOME environment variable. Set one of them to your SDK folder, then sync the project again.

Why does the error appear after opening a Flutter project?

Flutter projects opened in Android Studio sometimes keep a module SDK setting that does not match your installed platforms. Set the module SDK in File > Project Structure, and run flutter config --android-sdk with your SDK path if flutter doctor cannot find it.

Should I reinstall Android Studio to fix it?

Usually not. The SDK path, the installed platforms and the project files cause this error, not the IDE itself. Try every step in this guide first; reinstalling should be the very last option.

Sources

Last checked December 1, 2026. Menu names can differ slightly between Android Studio versions; the steps match current stable releases.

Where to go next

SDK fixed? Build your first real app

The free Android with Kotlin track takes you from a blank project to a Jetpack Compose app, step by step.

Start the Android Track