2

The Logcat shows the following error :-

 Error:(18, 1) A problem occurred evaluating project ':app'.

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

I have search out for this but don't find local.properties . Can anyone solve this?

Ishwinder
  • 37
  • 6
  • Possible duplicate of [SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID\_HOME environment variable](http://stackoverflow.com/questions/27620262/sdk-location-not-found-define-location-with-sdk-dir-in-the-local-properties-fil) – Harshad Pansuriya Jul 21 '16 at 05:34
  • But in Inetllij Idea 2016.2.1 don't find .local properties – Ishwinder Jul 21 '16 at 05:36
  • The `local.properties` file goes in the project's root level, in the same folder as the `gradlew`, `gradlew.bat`, `settings.gradle` and other files. – Harshad Pansuriya Jul 21 '16 at 05:41
  • there is not any file with that name – Ishwinder Jul 21 '16 at 05:43

2 Answers2

0

Error says it all

Your local.properties file should contain, in my case this line

sdk.dir=C\:\\Users\\johnrao\\AppData\\Local\\Android\\sdk
johnrao07
  • 6,690
  • 4
  • 32
  • 55
0

As your Error say that

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

to solve it you have to create it.

Note : This file in automatically createed. but as you can say that the file is not found. Then you have create it .

The local.properties file goes in the project's root level, in the same folder as the gradlew, gradlew.bat, settings.gradle and other files.

in local.properties contain this thing.

sdk.dir=C\:\\Program Files (x86)\\Android\\android-studio\\sdk

Note : the sdk.dir= reference to the location of the Android Studio SDK installation (which may be different on different machines

Harshad Pansuriya
  • 20,189
  • 8
  • 67
  • 95