SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in local.properties
Gradle doesn’t know where the Android SDK is installed.
SDK location not foundDefine a valid SDK location with an ANDROID_HOME environment variable Meaning
local.properties (not committed) holds sdk.dir. Fresh clones, CI machines and command-line builds without ANDROID_HOME fail. React Native/Flutter projects hit it the same way.
Common causes
- local.properties missing (fresh clone, CI)
- ANDROID_HOME/ANDROID_SDK_ROOT not set
- SDK not installed or moved
⚡ Quick fix
- Create local.properties with sdk.dir
- Set ANDROID_HOME in your shell profile/CI
- Install the SDK via Android Studio or sdkmanager
Detailed fix by platform
Shell
- kotlin
echo "sdk.dir=$HOME/Library/Android/sdk" > android/local.properties export ANDROID_HOME=$HOME/Library/Android/sdk
How to diagnose
- File — local.properties present?
- Env — echo $ANDROID_HOME
- SDK — Folder exists?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- adb server version doesn't match adb server version (41) doesn't match this client (39); killing...
- Android license status unknown / licenses not accepted flutter doctor: Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses
- Android resource linking failed AAPT: error: resource x (aka y) not found — Android resource linking failed
Most viewed in Android
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 13 Oct 2026