99

I'm attempting to build my first F# Android project in Visual Studio 2017 (Community Edition).

Immediately after creating a new project by using the F# - Android - Blank App template, the error window in Visual Studio displays the following message:

The project Foo is missing Android SDKs required for building. Double-click on this message and follow the prompts to install them.

No amount of double-clicking on the message causes prompts to appear.

I can't find an obvious place to download the Android SDK from:

The SDK manager that I remember from a while ago seems to have disappeared from the Android developer website.

I've installed Android Studio, which seemed to download some Android SDKs, but Visual Studio still can't seem to find whatever it's looking for.

Ronak Vachhani
  • 214
  • 2
  • 14
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
  • 1
    FWIW, There are two possible reasons installing Android Studio didn't help (I tried that also): 1) A.S. installs to a different location - and changing its SDK Manager location to match V.S./Xamarin options doesn't work - A.S. doesn't cope with a location under "Program Files (x86)" - not sure if it is permissions or the spaces in the path name. So one option is to change the VS/Xamarin/Android setting to match what A.S. uses. HOWEVER 2) A.S. may install a *different Android SDK Platform version* than the project was set to use. (In my case, platform 27 vs 28.) Can tell AS to install... – ToolmakerSteve Jan 29 '19 at 23:13
  • 1
    ... but the accepted answer is a simpler fix. I just am explaining some underlying details, in case that is useful to someone. – ToolmakerSteve Jan 29 '19 at 23:15

7 Answers7

224

I had the same issue... and Tools -> Android -> Android SDK Manager was greyed out for me.

In the end I needed to go to Tools -> Options -> Xamarin -> Android Settings and then make sure that the "Auto Install Android SDKs" was ticked. Once I ticked this and then double clicked on the error the install window suddenly appeared.

Per teapeng's answer, you may need to restart Visual Studio for this change to take effect.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
Frank
  • 2,256
  • 2
  • 6
  • 3
  • 3
    Thank you. I have same problem and check the "Auto Install Android SDKs". It's working fine on Latest VS 2017 Community version 15.9.2 – Ortsbo Nov 29 '18 at 01:05
  • Thanks for the solution. After applying, you can just do a Rebuild too. – Jnr Feb 02 '19 at 11:50
  • I have no such option there: "Auto Install Android SDKs" – tk_ Feb 04 '20 at 11:52
  • 1
    I followed these steps and now I'm getting prompted to install the SDK that I need. But when I click Accept I get the same error and the exact same prompt to install the exact same SDK I just accepted – DoragonSoruja Nov 29 '21 at 21:10
25

Visual Studio includes an Android SDK Manager that you use to download Android SDK tools, platforms, and other components that you need for developing Xamarin.Android apps.

See Tools -> Android -> Android SDK Manager.

Under Platforms you'll find various Android versions for the emulator and under Tools you can install various tools.

Also

See Tools -> Options -> Xamarin -> Android Settings

There is a folder path called Android SDK Location, if it's empty you can browse for it yourself to find it.

Jan Andersen
  • 773
  • 1
  • 6
  • 13
  • 3
    Thanks. I also had to install "Android 6.0 - Marshmallow" -> "Android SDK Platform 23" to make the error go away. I discovered _that_ by attempting to run the project; there was a more informative error in the output window. – Roger Lipscombe Sep 02 '18 at 09:03
14

Go to the following location:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Xamarin\AndroidSdkManager 

Then run the AndroidSDK Manager Executable.

In bottom right corner, click the gear icon and change the repository to Google.

you can see the gear here

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Chris Petrillo
  • 141
  • 1
  • 3
2

Well I have did these two and still cannot work,

1) Tools -> Android -> Android SDK Manager

2) Tools -> Options -> Xamarin -> Android Settings and then make sure that the "Auto Install Android SDKs" was ticked

How I solve it is restart Visual Studio and then it's running. Same old trick on Windows.

TPG
  • 2,811
  • 1
  • 31
  • 52
2

So in my case, the issue was the Visual Studio not being able to connect to the Android Server to download the files.

I did follow a thread from https://developercommunity.visualstudio.com/content/problem/241712/android-sdk-manager-fails-to-load-component-inform.html

What you can do is look up for this folder:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Xamarin\AndroidSdkManager

Create a new config file called: AndroidSdkManager.exe.config

And then add following values to the config:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>
<system.net>
<defaultProxy useDefaultCredentials="true" >
</defaultProxy>
</system.net>
</configuration>

This resolved issue and Visual Studio downloaded the necessary files.

Hope this is helpful.

Drag0nKn1ght
  • 260
  • 1
  • 2
  • 13
  • It works for me. Looks like proxy were giving problem to install SDK even Auto Install was ticked. – Pratham May 06 '19 at 09:05
1

if you update visual studio then this error will occour tool solve it goto Tool>Options>scrool Down>Xamarin > check "Auto Install Android SDK"

then double click on error your require SDK will Install

after Installion done Restart Visual Studio

0

Since my Windows account was a standard user(Non admin). Running Visual Studio as Admin did the trick for me.

Siber195
  • 41
  • 2
  • 3