Getting this complaint from IntelliJ 13:
8:15:48 PM Gradle '<project>' project refresh failed:
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
Build file '/<project>/build.gradle' line: 20
: Gradle settings
I have tried to spam my local.properties in every directory I can think of but still getting this error. What gives?
The
local.properties
file goes in the project's root level, in the same folder as thegradlew
,gradlew.bat
,settings.gradle
and other files.This file should not be included in source control. After (incorrectly) including this in source control, then deleting the file locally, Android Studio re-created the file for me automatically.
Here is the example content of this file:
Note the
sdk.dir=
reference to the location of the Android Studio SDK installation (which may be different on different machines).