简体   繁体   English

Xamarin; Android 11.0 SDK 在 Visual Studio 中不可用; 目标框架

[英]Xamarin; Android 11.0 SDK is not available in Visual Studio; Target Framework

In a computer, I have installed Android 11.0 SDK for a Visual Studio 2019 Community installation and my Xamarin Android app is compiled correctly using this SDK. In a computer, I have installed Android 11.0 SDK for a Visual Studio 2019 Community installation and my Xamarin Android app is compiled correctly using this SDK. The SDK was installed automatically: SDK 自动安装: 在此处输入图像描述

Then I installed Visual Studio 2019 Community in another computer to compile my app there.然后我在另一台计算机上安装了 Visual Studio 2019 Community 以在那里编译我的应用程序。 But it seems the Android 11.0 SDK is no longer available:但似乎 Android 11.0 SDK 不再可用:

在此处输入图像描述

It is not installed automatically and I cannot find anywhere to install it manually.它不是自动安装的,我找不到手动安装它的地方。 What's wrong and how can I install Android 11.0 SDK on Visual Studio?出了什么问题,如何在 Visual Studio 上安装 Android 11.0 SDK?

After long searching and none of the solutions were working for me, i've found that the SDK can also be installed with the VS Installer.经过长时间的搜索,没有一个解决方案对我有用,我发现 SDK 也可以使用 VS Installer 安装。 The API level 30 (Android 11) was nowhere to be found to install, nor VS SDK Manager nor Android Studio SDK Manager (the AS SDK Manager didn't even work, could not load any SDK's) The API level 30 (Android 11) was nowhere to be found to install, nor VS SDK Manager nor Android Studio SDK Manager (the AS SDK Manager didn't even work, could not load any SDK's)

(See screenshots) Go to VS Installer -> Modify VS version -> Go to tab 'Individual Components' -> Search for SDK API level 30 -> Select and install (See screenshots) Go to VS Installer -> Modify VS version -> Go to tab 'Individual Components' -> Search for SDK API level 30 -> Select and install

After the first login you'll probably need to accept SDK licenses again as I had to.首次登录后,您可能需要再次接受 SDK 许可证,因为我必须这样做。

Hope this helps anyone who, like me, did not find any other solution working PS: I did update VS to its latest version before doing this, not sure if this is mandatory or not since I was on 16.10 before but if this doesn't work, try updating VS itself first.希望这可以帮助像我一样没有找到任何其他解决方案的人 PS:在执行此操作之前,我确实将 VS 更新到了最新版本,不确定这是否是强制性的,因为我之前在 16.10,但如果这不是工作,先尝试更新VS本身。

VS 安装程序主页

VS Installer 单个组件

As of now Android 11 is not officially supported in Visual Studio.截至目前,Android 11 在 Visual Studio 中不受官方支持。

So you have two options:所以你有两个选择:

  • Select to use unofficial repositories in that dialog Select 在该对话框中使用非官方存储库
  • Wait for the version 16.9 where it is supposed to be supported.等待应该支持的版本 16.9。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM