SDK location not found 🤖 Android

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

  1. Create local.properties with sdk.dir
  2. Set ANDROID_HOME in your shell profile/CI
  3. Install the SDK via Android Studio or sdkmanager

Detailed fix by platform

Shell

  1. kotlin
    echo "sdk.dir=$HOME/Library/Android/sdk" > android/local.properties
    export ANDROID_HOME=$HOME/Library/Android/sdk

How to diagnose

  1. File — local.properties present?
  2. Env — echo $ANDROID_HOME
  3. 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:

🧠 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.