该项目缺少构建所需的 Android SDK

我正试图在 VisualStudio2017(社区版)中构建我的第一个 F # Android 项目。

使用 F #-Android-Blank App 模板创建新项目后,Visual Studio 中的错误窗口会立即显示以下消息:

Foo 项目缺少构建所需的 Android SDK。双击此消息并按照提示安装它们。

无论多少次双击消息都不会显示提示。

我找不到一个明显可以下载 Android SDK 的地方:

我记得不久前的 SDK 管理器似乎已经从 Android 开发者网站上消失了。

我已经安装了 Android Studio,它似乎下载了一些 Android SDK,但 Visual Studio 似乎仍然找不到它要找的东西。

45370 次浏览

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.

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.

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

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.

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.

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

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