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.
Seen on:
Android
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
Most viewed in Android
Other ways to find it
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026