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.
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.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/SdkVerify: The path exists on this machine and contains Android SDK directories such as platform-tools or platforms.
Common SDK locations to check
Android Studio commonly uses
%LOCALAPPDATA%\Android\Sdk. Confirm it in SDK Manager instead of assuming.A common location is
~/Library/Android/sdk.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.
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
Use Android Studio SDK Manager or your known SDK location before editing paths.
Absolute SDK paths are machine-specific and commonly break after cloning or moving projects.
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/sdkVerify: 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.
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 tasksgradlew.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.
What not to do
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.
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.
Loading community discussion…
Comments could not load here. Open ErrorHarbor Discussions on GitHub →