SDK Location not found in android studio

I just imported the eclipse project into android studio. it keeps my saying that

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

I saw several lessons editing local.properties files, but it did not work. here is my project.properties file:

 sdk.dir=E:\\Mod Eclipse\\adt-bundle-windows-x86_64-20130219\\sdk 

Actual directory of my folder:

E: \ Mod Eclipse \ adt-bundle-windows-x86_64-20130219 \ sdk

+14
android android-studio
Aug 31 '14 at 21:03
source share
7 answers

You must also change it in the project structure.

  • Close the current project and you will see a pop-up dialog box, which then proceeds to the configuration.

    Configure β†’ Project default settings β†’ Project structure β†’ SDK in the left column β†’ Android SDK Home Path β†’ specify the exact path as you did on local.properties, and select Valid Target.

There you go.

+5
Aug. 31 '14 at 21:19
source share

A quick note about this, if you are trying to run a Facebook sample, and this error appears, make sure you select the build.gradle file in the Facebook sdk root folder for all samples when you "open an existing project." I got this error when I tried to open gradle just for the Scrumptious example from the 3.22 SDK

+27
Jan 07 '15 at 15:52
source share

If you are sure that you specified the correct SDK path in the project settings, and you can see it in local.properties , but still getting this error, there is a possibility that you missed something in your project.

I was getting the same error by looking into my project, I found that settings.gradle is missing. enter image description here and then add the following script to your build.gradle applications enter image description here You will no longer encounter this error. This worked for me, maybe gradle was configured to have a lock problem

+17
May 14 '15 at 4:39
source share

So, I had the same problem, and none of the answers given earlier helped me. I did a check for new API updates (in my case I upgraded to API level 23) and the problem was fixed.

+1
Oct. 25 '15 at 21:27
source share

You can add local.properties to set sdk.dir as sdk.dir=/Users/roofe/Library/Android/sdk .

But please pay attention below , which is very important,

add local.properties to the topmost project path. Here the top one has some difference with the root path of the project.

For example, in the project below, I just use the ijkplayer example, but this module also used a different module with a different processor architecture.

If I add only local.properties to the ijkplayer-example, this will not work. Here you will get the sdk location question for another module.

While I can add local.properties to the ijkplayer directory, then when I try to open the ijkplayer example project, local.properties for the ijkplayer example will be automatically created and everything will be fine.

enter image description here

0
Jun 07 '17 at 3:30
source share

The simplest solution is sometimes just File -> Invalidate Cache / Restart.

If that doesn’t help, move on to more complex things as suggested in other answers

0
Aug 11 '17 at 14:29
source share

In my case, it was a new installation with verification from github.

  • Just close the validation window.
  • Create a new project (not from git, just a new one).
  • exit the project.
  • check what you like

Its the fastest way to find.

0
Oct. 20 '17 at 21:17
source share



All Articles