Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Installer does not install Android SDK

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\.
like image 466
codemonkey Avatar asked Jan 11 '18 21:01

codemonkey


3 Answers

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!
like image 150
Nick Cardoso Avatar answered Sep 20 '22 10:09

Nick Cardoso


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.

like image 43
Brian Knoblauch Avatar answered Sep 23 '22 10:09

Brian Knoblauch


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.

like image 23
Thomas Avatar answered Sep 19 '22 10:09

Thomas