Android SDK Location Not Found: Fix sdk.dir in local.properties

The Android build needs a machine-specific path to the installed SDK. local.properties is where Android’s build tooling can store that local sdk.dir value.

Android Studio · GradleWindows · macOS · LinuxLast reviewed Sep 25, 2026
🎯 You’re likely in the right place if:
Gradle or Android Studio reports SDK location not found.The project was cloned, moved to another machine, or opened outside Android Studio.The Android SDK is installed but the project cannot locate it.
Choose the path that matches what you see
Android Studio shows an SDK pathUse that exact path for sdk.dir on this machine.
Project was cloned from another computerReplace the stale machine-specific local.properties value; do not reuse someone else’s absolute path.
local.properties is missingCreate it only after confirming the local SDK directory.
Failure is CI/headless onlyPrefer a correctly configured SDK environment for the runner; ANDROID_HOME points to the SDK, while ANDROID_SDK_ROOT is deprecated.
Difficulty: Easy–ModerateRisk: Low first
🔎 Quick Check — verify the local SDK path

Find the Android SDK location on this machine, then inspect the project root local.properties file for an sdk.dir entry that points to it.

sdk.dir=/absolute/path/to/Android/Sdk

Verify: The path exists on this machine and contains Android SDK directories such as platform-tools or platforms.

Did sdk.dir point to the wrong or missing path?

Common SDK locations to check

W
Windows
Android Studio commonly uses %LOCALAPPDATA%\Android\Sdk. Confirm it in SDK Manager instead of assuming.
M
macOS
A common location is ~/Library/Android/sdk.
L
Linux
A common location is ~/Android/Sdk.

Treat these as common defaults, not proof. Android Studio’s SDK Manager is the authoritative location on your machine.

ADSENSE · reserved slot after the first useful step

Why this happens

Android’s official build documentation describes local.properties as machine-local configuration and sdk.dir as the path to the Android SDK. That file should not be treated as a portable project dependency file.

Diagnose before changing more

1
Does the SDK actually exist?
Use Android Studio SDK Manager or your known SDK location before editing paths.
2
Is local.properties from another computer?
Absolute SDK paths are machine-specific and commonly break after cloning or moving projects.
3
Is local.properties missing?
Create it in the project root only after you know the correct local SDK path.

Fix #2 — write the correct sdk.dir for this machine

Set sdk.dir in the root local.properties file to the actual SDK directory. Use the path format appropriate for your operating system.

sdk.dir=/Users/you/Library/Android/sdk
🟡 Before changing configuration: Do not commit another developer’s absolute SDK path into source control.

Verify: Sync or rerun the failed Gradle task. If the build moves past “SDK location not found,” the path issue is fixed even if a new, unrelated build error appears.

Did Fix #2 work?

Fix #3 — sync the project after correcting the local path

After saving local.properties, sync the project with Gradle files or rerun the Gradle task that failed. If a new error appears, treat that as the next issue rather than continuing to change the SDK path.

./gradlew tasks
🟡 Keep it reversible: On Windows, run the Gradle wrapper command appropriate for your shell, such as gradlew.bat tasks.

Verify: The Gradle wrapper should start configuration without the SDK-location error. On CI, verify the runner sees the intended SDK path before debugging project dependencies.

Did Fix #3 work?

What not to do

Do not commit a personal absolute sdk.dir path to source control.Do not put arbitrary custom project settings in local.properties; Android reserves it for specific local build properties.Do not set deprecated ANDROID_SDK_ROOT when ANDROID_HOME already points to the SDK unless legacy tooling explicitly requires it.

Still seeing the error?

If sdk.dir is correct but the build still cannot find the SDK, verify permissions and that the directory is a complete Android SDK installation. Then inspect environment-specific tooling or CI configuration separately.

Before escalating, capture:the exact Gradle/Android Studio error textthe SDK path shown by Android Studio SDK Managerthe current sdk.dir line with your username/path redacted if sharing publiclywhether the failure is local, CI-only, or both

Official references

Still stuck? Ask the community

Share your operating system, software version, exact error text, and which fix you already tried. Another reader may have seen the same setup.

Keep it safe: never post passwords, API keys, access tokens, recovery codes, license keys, private URLs, or confidential logs.
Powered by GitHub DiscussionsSign in with GitHub to comment. Reading comments does not require sign-in.

Loading community discussion…