2

When I try to run a new blank Android app I get an error:

"The Android SDK Directory could not be found...".

I searched in google for a solution and I found out that I need to go to Tools -> Android -> Android SDK Manager, and then I realized the buttons are disabled.

I did some checks: in Tools -> Options -> Android Setting for Android SDK Location and it's empty. Furthermore, the folder Programs Files(x86)\Android\android-sdk contain only 1 folder named extras

I did a VS repair, twice, and nothing changed.

As I understand the problem, I don't have SDK and somehow VS can't install it properly.

Is there any manual way to install it or any other solution?

Edit: I've tried to uninstall Visual Studio and install again. It couldn't install everything successfully, here is the log:

Package 'JavaJDKV2,version=1.8.6,chip=x64' failed to install. Search URL https://aka.ms/VSSetupErrorReports?q=PackageId=JavaJDKV2;PackageAction=Install;ReturnCode=-1 Details Command executed: "C:\ProgramData\Microsoft\VisualStudio\Packages\JavaJDKV2,version=1.8.6,chip=x64\jdk-8u181-windows-x64.exe" /quiet Return code: -1 Return code details: Unknown error (0xffffffff) Log C:\Users******\AppData\Local\Temp\dd_setup_20180828172213_290_JavaJDKV2.log Impacted workloads Mobile development with .NET (Microsoft.VisualStudio.Workload.NetCrossPlat,version=15.8.27906.1) Impacted components Android SDK setup (API level 27) (Component.Android.SDK27,version=15.8.27906.1) Google Android Emulator (API Level 27) (Component.Google.Android.Emulator.API27,version=15.8.27906.1) Java SE Development Kit (8.0.1120.15) (Component.JavaJDK,version=15.6.27406.0)

Dor Meiri
  • 389
  • 1
  • 4
  • 13
  • Have you tried installing sdk using android sdk manager ? you can find it in Tools-> Android-->android sdk manager – Ronak Shetiya Aug 28 '18 at 11:20
  • Everything under Tools -> Android is disabled – Dor Meiri Aug 28 '18 at 11:24
  • probably you are facing this issue because Android SDK Platform-tools is been uninstalled [link](https://stackoverflow.com/questions/24949446/android-bat-file-is-missing-in-sdk-tools-folder-also-i-do-not-having-avd-sdk-m) check this – Ronak Shetiya Aug 28 '18 at 11:29
  • In that answer, the path of where to put the 'tools' folder is not mentioned. I tried to put it in Program Files(x86)\Android\android-sdk, it doesn't work. – Dor Meiri Aug 28 '18 at 14:09
  • 1
    you need to put the path where your android-sdk has been installed in my case its C:\Program Files (x86)\Android\android-sdk – Ronak Shetiya Aug 29 '18 at 05:55

3 Answers3

1

I fixed it and here is what worked for me:

  1. I downloaded the Android Command line tools
  2. I put the downloaded folder in C:\Program Files (x86)\Android\android-sdk
  3. I opened CMD and directed to that folder.
  4. I've checked the command sdkmanager --list, see sdkmanager page for more information
  5. And I downloaded via the sdkmanager commands the SDKs I needed
  6. Also, VS2017's SDK manager started to work as well after I downloaded what I needed from the command line.
Dor Meiri
  • 389
  • 1
  • 4
  • 13
0

download the latest version of "sdk-tools-windows-4333796.zip" in https://developer.android.com/studio this web site and update your visual studio to latest version

this will surely work because even in my case it was same error for 3days then i did these changes and now it works fine

0

Install Android studio - https://developer.android.com/studio Open Android studio -> configure -> copy Android SDK location Open Visual studio -> Tools -> Options -> Xamarin -> paste your SDK location Done!

Etnic
  • 76
  • 1
  • 6