Error: SDK location not found even though it is correct in local.properties
I have cloned an Android project:
$ git clone https://email@example.com/company/company-android-app.git $ cd company-android-app $ ls app/ build.gradle firebase/ gradle/ gradle.properties gradlew gradlew.bat settings.gradle
When I try to open the app folder with android studio to start working with the project, I get
Gradle 'app' project refresh failed and
Error: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.. The thing is, the SDK location is already set in local.properties:
This is the same location as in other android projects that I have worked with on this machine. So why am I getting this error, and how to fix it?
EDIT Additional info: I've checked in the configurations that the path has been set properly:
I can't see anything wrong with this.
Happened to me on a Windows 10 machine, had delete .Android , .AndroidStudio and .gradle folder (entire android studio cache) and start fresh. at the very beginning of android studio setup it asks for sdk location i provide it there and it worked like charm
When I first opened the project in Android studio, I opened the
/appdirectory. When I closed the project and opened the enclosing folder instead, it worked.