1

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.

Dimitar
  • 4,402
  • 4
  • 31
  • 47

2 Answers2

1

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/

Shridutt Kothari
  • 7,326
  • 3
  • 41
  • 61
  • my local.properties file is already at the project root. I have followed the same project structure as my other projects have. – Gaurav Tiwari Aug 19 '16 at 07:13
1

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