USER_8675309
USER_8675309

Reputation: 893

What version of Xamarin.Android.Support do I need from nuget for minimum Android 5.0 API 21 (Lollipop)?

When I create a Universal Blank App and attempt to upgrade my NuGet packages, it tells me

Could not install package 'Xamarin.Android.Support.v4 25.1.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 understand that I need an older version of Xamarin.Android.Support.v4, but I couldn't find any reference guide on which is the latest version of the NuGet package works for my build. Is there a place I can look to find this information ?

Upvotes: 0

Views: 707

Answers (1)

Jon Douglas
Jon Douglas

Reputation: 13176

You can look at NuGet.org.

This error message is telling you that it requires MonoAndroid 6.0 to install into. This means that you need to set your <TargetFrameworkVersion> to 6.0 or higher. This is also synonymous with setting your Android version to compile against 6.0.

https://developer.xamarin.com/guides/android/application_fundamentals/understanding_android_api_levels/#framework

Please note that you can support APIs all the way back to whatever your MinSdkVersion is set to. It is not dependent of your TargetFrameworkVersion, as this is a common misunderstanding.

https://developer.xamarin.com/guides/android/application_fundamentals/understanding_android_api_levels/#minimum

My advice is to compile against the latest API version and to set your minimum API version to the lowest level you need to consider. You can read more about that here.

https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#considerations

Finally to see a historical version history of this library, you can simply search on NuGet.org:

https://www.nuget.org/packages/Xamarin.Android.Support.v4/

Please note that you will most likely need to download the lib via the download button on the side, extract the nupkg and view inside the lib folder which will be named the respective target you need.

Upvotes: 1

Related Questions