14

The first installation it was fine, Android Studio and the SDK was installed properly. Later on I have a problem with SDK and had to reinstall Android Studio. But when I try to reinstall Android Studio, I can't see an option to install the SDK:

installation screen

And when I launch Android Studio, I am getting the error:
"Please provide the path to the Android SDK."

Select SDKs

How can I install the SDK properly?

What I tried:

  • Reinstalling Android Studio,
  • Removing the Android folder in \%USER%\AppData\Local\.
BrokenBenchmark
  • 18,126
  • 7
  • 21
  • 33
codemonkey
  • 809
  • 1
  • 9
  • 21
  • Probably because it is already installed on your PC. You need to find path of it and provide in that box. Usually path is on C and AppData for example something like this: `C:\Users\YourUserName\AppData\Local\Android\sdk` – Yupi Jan 11 '18 at 21:29
  • 1
    @Yupi No. It is not installed, and there is no folder called "Android" in local. – codemonkey Jan 11 '18 at 21:32
  • Same issue here. I've cleaned AppData, ProgramData, all the Android directories local and root. Problem persists. – Brian Knoblauch May 21 '18 at 13:29

7 Answers7

21

Answers here are out of date or wrong and so many sources have the wrong info or only part of it. You can use the following steps (steps for windows, but you can adapt):

  • Go to the download page which Android Studio dialog links which is here
  • Close Android Studio
  • Under 'Command line tools only' download the zip for your platform
  • Extract the zip to <drive>/Users/<Username>/AppData/Local/Android/Sdk
  • It created the directory cmdline-tools with the wrong sub structure
    • Create <drive>/Users/<Username>/AppData/Local/Android/Sdk/cmdline-tools/latest
    • Move the cmdline-tools bin and lib folders (and any other files) inside the latest dir
  • Open a command prompt (run as administrator)
  • Execute cd <drive>/Users/<Username>/AppData/Local/Android/Sdk/cmdline-tools/latest/bin
  • Execute sdkmanager "platforms;android-28" (or pick a platform of your own)
  • Accept the license with y and wait
  • Restart Android studio, et voila!
Nick Cardoso
  • 20,807
  • 14
  • 73
  • 124
5

I finally found the solution this morning after battling Android Studio/SDK for quite some time! In my local AppData I deleted the .gradle directory (which was just short of 2 GiB) and I now get an SDK during Android Studio install.

Brian Knoblauch
  • 20,639
  • 15
  • 57
  • 92
  • I cannot find the .gradle directory in AppData/Local/Google/AndroidStudio4.1 Can you please help me out? – Huzaifa Asif Oct 14 '20 at 06:12
  • This is only half of an answer right now. There is no .gradle folder in either Android or Google in AppData/Local. You need to say where it is supposed to be/what you deleted – Nick Cardoso Dec 11 '20 at 09:01
4

I went through the installation process, opened Android Studio & went to import an existing project. The SDK folder was absent, there were no SDK platforms installed & I couldn't check-select them for installation through the settings.

Closing Android Studio and then re-opening it as administrator prompted the downloading of additional components (SDK tools, emulator-related stuff, etc), solving the issue.

Andreas
  • 2,455
  • 10
  • 21
  • 24
Thomas
  • 97
  • 6
3

I think latest android studio is not coming with sdk. You need to install manually.

  1. Select File > Settings > Appearance & Behavior > System Settings > Android SDK > Edit option.

enter image description here

  1. Click on Next > Accept > Finish.

enter image description here

pathe.kiran
  • 2,444
  • 1
  • 21
  • 27
0

I think the main reason can be a network issue, like VPN, not using a public connection,firewall,... as people suggest: as they suggest here

In my case I was using a corporate network, using my personal WIFI or mobile connection show me the SDK choices:

  1. after you change the directory to something else like(in the ): in my case I use that path C:\Users\ $yourusername \ .android

  2. and then finally I can see the SDK options after unchecking hidden choice, but cant install if I am on a filtered network as I said above. failed terminal output SDK installation screenshot After the terminal within Android studio install the SDK related components, you can now see/find that directory C:\Users$username\ AppData\ Local \ Android \ Sdk

EDIT, to summarize:

So basically be sure to use the newtwork that doesnt have firewall exc.(for me doesnt work even if I accept the certificates...and whitelist android studio...) and finish the complete set up(SDK tools,AVD...) on that network who SDK installation dialog appers(you dont need to reinstall, when you lunch Android Studio)

Atom94
  • 1
  • 4
-1

Removing all Android-related files and folders from %userprofile% didn't help in my case. Additionally I removed registry keys:

  • HKLM\Software\Wow6432Node\Android SDK tools
  • HKLM\System\ControlSet001\Control\Session manager\Environment\ANDROID_HOME
  • HKCU\Software\Classes\VirtualStore\Machine\Software\Wow6432Node\Android SDK tools

In other words, all that contained path to where I previously installed SDK. Only then Studio stopped assuring me that SDK "is installed"

hamthenormal
  • 856
  • 8
  • 21
Fr0sT
  • 2,959
  • 2
  • 25
  • 18
  • 2
    all these path's is not contains anything about AS or sdk – MML May 14 '21 at 05:47
  • @MML path "HKLM\Software\Wow6432Node\Android SDK tools" contains anything about AS or sdk? Good joke – Fr0sT May 17 '21 at 09:03
  • 1
    @MML you have no such paths at all. That's not what you said before. Anyway if you got none of these paths, you've nothing to remove! In my system, contrary, there were all of them – Fr0sT May 18 '21 at 13:27
-3

Finally found the culprit. Deleting the .gradle folder in my %userprofile% (not Appdata) fixed the issue. After deleting it, the Android Studio installer offered to install the Android SDK during the initial setup.

Fox
  • 1