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

查看:120
本文介绍了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版本编译"选项仅在23(Android 6.0)之前显示api.我想以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,我可以很好地将Androd 7.1定位为目标.

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

要检查更新,应打开工具> 选项> Xamarin > 其他,然后单击立即检查.

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

Visual Studio 2017更新:

如果您使用的是Visual Studio 2017或更高版本,则Xamarin更新将作为Visual Studio更新的一部分提供.要手动检查更新,请转到工具> 扩展和更新... 在左侧菜单中,打开更新并选择产品更新.如果有可用更新,则这些更新将显示在此列表中.

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天全站免登陆