Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
434 views
in Technique[技术] by (71.8m points)

xamarin - Visual Studio not showing installed Android api levels

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.

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.

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.

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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

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


Update for Visual Studio 2017:

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 2017 update


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...