Visual Studio 未显示已安装的 Android api 级别 [英] Visual Studio not showing installed Android api levels

查看:30
本文介绍了Visual Studio 未显示已安装的 Android api 级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Visual Studio 中开发 Android 应用.在 Android SDK 管理器中,安装了从 API 级别 23 (Android 6.0) 到 API 级别 25 (Android 7.1) 的所有 API.

I am developing an Android app in Visual Studio. In the Android SDK manager, all API's from API level 23 (Android 6.0) to API level 25 (Android 7.1) are installed.

但是当我在 Visual Studio 中打开项目属性时,使用 Android 版本编译"选项只显示 apis 直到 23(Android 6.0).我想以 7.1 为目标,因为现在大多数智能手机都将拥有它.

But when I open the project properties in Visual Studio, the "Compile using Android version" option is showing apis only till 23(Android 6.0). I want to target 7.1 as most of the smartphones will now have it.

如果我使用 Android 6.0,还有另一个问题.某些软件包(如 Xamarin.Firebase.Messaging)无法安装并显示以下错误.

There are another problem if I go with Android 6.0. Some packages like Xamarin.Firebase.Messaging fails to install with the following error.

Install-Package: Could not install package 'Xamarin.Firebase.Messaging 42.1001.0'. 
You are trying to install this package into a 
project that targets 'MonoAndroid,Version=v6.0', but the package does not contain
any assembly references or content files that are 
compatible with that framework. For more information, contact the package author.

我可以看到 API 级别 25 下可用的所有选项都安装在 SDK 管理器中.请帮助我,以便我可以从 Visual Studio Android 应用程序定位到 Android 7.1.谢谢

I can see that all options available under API level 25 are installed in SDK manager. Kindly help me so that i can target Android 7.1 from the Visual Studio Android app. Thanks

推荐答案

你的 Xamarin 安装是最新的吗?我怀疑您的 Xamarin.Android 版本是 6.x,这意味着即使它们是通过 SDK 管理器安装的,您也无法针对 Android 7.0 或 7.1.您可以从帮助 > 关于 Microsoft Visual Studio 中查看版本.

Is your Xamarin installation up to date? I suspect that your version of Xamarin.Android is 6.x which means that you won't be able to target Android 7.0 or 7.1 even if they are installed through the SDK manager. You can check the version from Help > About Microsoft Visual Studio.

例如,我的版本是 7.1.0.19,我可以很好地定位 Android 7.1.

For example, my version is 7.1.0.19 and I'm able to target Androd 7.1 just fine.

要检查更新,您应该打开Tools > Options > Xamarin > Other 并单击立即检查.

To check for updates, you should open Tools > Options > Xamarin > Other and click Check now.

Visual Studio 2017 更新:

如果您使用的是 Visual Studio 2017 或更高版本,Xamarin 更新将作为 Visual Studio 更新的一部分提供.要手动检查更新,请转至 Tools > Extensions and Updates... 在左侧菜单中,打开 Updates 并选择 产品更新.如果有可用更新,它们将显示在此列表中.

If you're using Visual Studio 2017 or newer, Xamarin updates are delivered as part of Visual Studio updates. To manually check for updates, go to Tools > Extensions and Updates... In the left hand menu, open Updates and select Product Updates. If there are updates available, they will be shown on this list.

这篇关于Visual Studio 未显示已安装的 Android api 级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆