15

I am an android programmer, i use eclipse. i want to try android studio, thus, i download it and tried to open it.

it says that i have to put the sdk path.

what i have tried

i tried to set it to my the android-sdk which eclipse is working on it. that sdk is up to date and have all the supports, apis ...etc.

also

i found a question here in the stackoverflow about my problem: Android-studio Selected directory is not valid home for Android SDK The solution was to open the android studio and then press f4 and then go to platform setting and the press the plus green sign then select the sdk then select the path to my android-sdk, i did all of that but android studio keeps telling me that the

The selected directory is not a valid home for Android SDK

any help would be appreciated

Community
  • 1
  • 1
Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253
  • If you are on Windows, try to set the `ANDROID_SDK_HOME` environment variable to the android SDK folder you want to use. – free3dom Aug 08 '13 at 07:39
  • None of the answers here worked for me but this one did. https://stackoverflow.com/questions/21794272/android-sdk-is-missing-out-of-date-or-is-missing-templates-please-ensure-you – John81 Jul 02 '18 at 11:52

11 Answers11

18

I found the solution myself, the answer was to run android studio as an administrator :P

Brad Koch
  • 19,267
  • 19
  • 110
  • 137
Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253
  • 1
    Thi is the best answer. Also, just to add a small detail: When you open Android Studio, it will still ask to enter the sdk manager path. Ignore this message, go to Tools > SDK Manager then click on the folder of the sdk manager and click next next next. That's it! – abelabbesnabi Sep 01 '19 at 23:02
11

Had the same problem. I was trying to select

C:\Program Files (x86)\Android\android-sdk\platforms\android-XX

But what I actually had to do was to select android-sdk folder.

C:\Program Files (x86)\Android\android-sdk

Then I was able to choose the API I wanted from a list of APIs that would show up.

Ghasem
  • 14,455
  • 21
  • 138
  • 171
4

I had this problem, select SDK folder (NOT SDK->sources or SDK-platforms)

Abbath
  • 1,002
  • 13
  • 30
3

I found another solution make sure that you have write access to that directory. That fixed the issue for me.

rekire
  • 47,260
  • 30
  • 167
  • 264
2

Another way this may need to be fixed is by making sure there is at least one SDK platform installed. Run in the commandline from the android-sdk folder:

.\tools\bin\sdkmanager.bat platforms;android-XX

where XX is the any Android SDK version.

Edward Peek
  • 163
  • 1
  • 5
1

It might occurs, if Android Studio tries to open the previous project with ".idea" directory. Well, solution is to remove that folder and .iml file too.

Works for me.

inaps
  • 1,516
  • 1
  • 9
  • 14
0

What helped for me was moving the android sdk to a folder without any special characters (e.g. no "Program Files (x86)").

koljaTM
  • 10,064
  • 2
  • 40
  • 42
0

In intellij idea File -> Invalidate Caches/Restart

Asatur Meltonyan
  • 760
  • 7
  • 15
0

I solved it from here http://www.blog.teamguru.in/2018/04/06/selected-directory-is-not-a-valid-home-for-sdk/

1- Just close current error window and let run the android studio 2- open sdk manager as shown in below

3- Clik on Edit sdk location as below

4- Simply press next button if there is correct location for sdk you want to install there

5- let it be downloaded

6- install platform and SDK tools and

7- Enjoy

user3762527
  • 99
  • 1
  • 4
0

For me the problem was I copied the previous Android Studio settings from my old computer, and then I imported them. But I didn't copy the old SDK! Probably the SDK path is also configured somewhere in the old settings. Instead of download them, Android Studio kept complaining about my SDK location. Finally, I also just copied the old SDK directory and then the problem was solved.

ffonz
  • 1,304
  • 1
  • 11
  • 29
-1

Problem Statement selected directory is not a valid home for sdk

I have resolved from here

http://www.blog.teamguru.in/2018/04/06/selected-directory-is-not-a-valid-home-for-sdk/

1- Just close current error window and let run the android studio 2- open sdk manager as shown in below

3- Clik on Edit sdk location as below

4- Simply press next button if there is correct location for sdk you want to install there

5- let it be downloaded

6- install platform and SDK tools and

7- Enjoy

user3762527
  • 99
  • 1
  • 4