Gaurav Tiwari
Gaurav Tiwari

Reputation: 85

Error SDK location not found

I cloned the project from gitHub to check the sample code on segment.io. After importing into the android studio I am getting the error

Error:SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

I changed the SDK location in local.properties to my current SDK location which is

sdk.dir = /home/mobiefit/Android/Sdk

But I am still getting the same error.

Upvotes: 1

Views: 658

Answers (2)

Vivek Singh
Vivek Singh

Reputation: 21

while importing code this will come:

Android Studio will use this Android SDK instead: 'F:\sdk' and will modify the project's local.properties file.

then say ok.. that's all...

Upvotes: 1

Shridutt Kothari
Shridutt Kothari

Reputation: 7394

There are only three ways to do it:

create local.properties file and have either sdk.dir or android.dir line. have ANDROID_HOME environment variable defined.

While your Android Studio knows that the SDK is at that place, I doubt that Android Studio is passing that information to gradle and thus we're seeing that error.

You need to create local.properties file at the project root and put the following line and it should compile the code successfully.

ex sdk.dir = /Applications/Android Studio.app/sdk/

Upvotes: 1

Related Questions