27

I installed android studio but while selecting android SDK I am getting following error. I tried solution which is on this post but no luck. How can I solve this?

error screenshot 1

error screenshot 2

EffyCoder
  • 48
  • 1
  • 6
vnshetty
  • 20,051
  • 23
  • 64
  • 102

15 Answers15

16

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

Abbath
  • 1,002
  • 13
  • 30
10

I resolved with the instructions 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 the SDK manager as shown below
  3. Click on Edit SDK location as shown 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
MLM
  • 3,660
  • 3
  • 41
  • 66
user3762527
  • 99
  • 1
  • 4
6

I got the same issue. You must enable the Android Support Plugin Configuration > Plugin > Android Support Plugin. Check it.

53iScott
  • 827
  • 1
  • 13
  • 18
5

Try restarting the application. Close all related studio processes, then right click "run as administrator".

You should be fine after this.

narasi
  • 463
  • 3
  • 8
  • I also had the problem of "The selected directory is not a valid home for Android SDK", even after I had updated SDK. (I had an eclipse installation already, that was outdated) Once I ran Android Studio with admin rights, I was able to set the Android SDK path to the sdk folder in my eclipse instalation that I updated. – Xilconic May 30 '13 at 20:13
  • Admin rights don't solve this problem. One has to completely uninstall and reinstall Android Studio! – IgorGanapolsky Sep 04 '13 at 16:08
4
  1. Close error window
  2. Go to gradle tab
  3. select "Gradle settings", wrench icon
  4. Search for SDK setup
  5. Select appropriate sdk for your device.
  6. Next, two times
  7. Wait for install There is all..
2

None of the other answers work. After the installation, immediately close Android Studio, then start it as administrator. A message might popup asking for the sdk manager location. Ignore it (Close the popup). Go to Tools > SDK Manager and click on the edit button on the right of Android SDK Location. Then click Next, next and you're good to go. Android Studio will let you install the sdk manager.

enter image description here

abelabbesnabi
  • 1,819
  • 1
  • 16
  • 21
1

I had the same problem but what I found is that it requires the parent folder of the following things AVD manager,SDK manager,tools,platform-tools,build-tools etc.So what you need is to find the parent directory of these things, which you might find with a name such as android-sdk or android-sdk-windows(in case you are using windows OS).Make sure the above said contents are in that folder and select it.I hope you will find this useful.

EffyCoder
  • 48
  • 1
  • 6
0

Download the SDK from http://developer.android.com/sdk/index.html

Start SDK manager and make everything up to date

Also, make sure you have set the language level to

  • 7.0 Diamonds, ARM, Multi-catch, etc
Jakob Eriksson
  • 18,597
  • 1
  • 25
  • 34
0

I had this problem on Linux. Apparently you need write access to some place in that directory, so I just took ownership of the entire thing:

sudo chown -R thomas:thomas /opt/android-sdk

Could be that something similar is going on on Windows as well.

Thomas
  • 174,939
  • 50
  • 355
  • 478
0

If like me, a MacOs user which has installed Android Studio on my Mac and if you've tried everything you can think of but was still unable to set the Android SDK directory in Android Studio, follow the next steps (I know the site where I got the bundle is a freeware site but the package is the right one):

1. Download adt-bundle-mac (Android Developer Tools) from [here][1].
2. Unzip the file and browse into the unzipped folder.
3. Copy only the sdk dir to /Users/username/Library/Android 
4. Open Android Studio, the error about the SDK folder which is not set will pop up, set the path to the SDK to "/Users/username/Library/Android/sdk".
5. Now Android Studio will accept the path and you're good to go.

I wasted about 2 hours until I fixed it so I hope that by writing this answer I'll save you some 2 hours.

Itai Ganot
  • 5,873
  • 18
  • 56
  • 99
0

The sdk folder contains the platform-tools folder.
I copied this folder and named it platforms, then it worked for me.

Leandro
  • 376
  • 5
  • 16
0

Steps to follow:

  1. Close Android Studio.
  2. Restart Android Studio and Give the path of Empty Folder .
  3. Install Sdk in that folder(Sdk will automatically install and will get configure automatically.)
4b0
  • 21,981
  • 30
  • 95
  • 142
0

Just delete(preferably permanently) all the android directories in whatever location they are present(e.g. C:\Program Files\Android, C:\users\respective user\respective android folders). Remove the installer as well(if possible). Make sure to save all your Android Studio files in some external storage (preferably).

The main thing is to get Android studio with SDK.

Now go to the android studio website and install android studio leaving all settings default. There you will also get to install the SDK and it's linking.

It will take some time to load and will load nearly 1.5 GB files.

This worked for my case.

Sunil Lulla
  • 797
  • 10
  • 18
0

In my case I wasn't giving him admin permission

0

With Android Studio 4.1.2 the easiest thing is to close the project (file / close project). That's how you get to the wizard that automatically sets up the SDK for you.

The default location that it suggests is /Users/stan/Library/Android/sdk (exactly the same that I was trying to set up manually but AS kept saying it's invalid)

Stan
  • 2,151
  • 1
  • 25
  • 33