Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install Xamarin.Android.Support.v4

I am trying to install this particular package into my program and get the following error:

Error Could not install package 'Xamarin.Android.Support.Compat 24.2.1'. 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.

What exactly is my project suppost to target and how do I make this change? I already installed android 7, however I cannot even target that for some strange reason. Not even if I make a new project I can't target that.

like image 898
DaveK Avatar asked Oct 28 '16 15:10

DaveK


2 Answers

This package requires MonoAndroid70 to be installed. Thus you need to ensure your TargetFrameworkVersion is set to a minimum of Android 7.0. You will need to install API 24(7.0) and change the version.

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

For those interested in how you would find this, you can download the .nupkg from NuGet:

https://www.nuget.org/api/v2/package/Xamarin.Android.Support.v4/24.2.1

You can then extract the .nupkg and view the lib folder which will show you what the library supports.

like image 152
Jon Douglas Avatar answered Oct 19 '22 12:10

Jon Douglas


I recommend below steps

1- download a previous version (

<package id="Xamarin.Android.Support.v4" version="23.1.1.1" targetFramework="monoandroid60" />

)

2- delete the following local folder "..\AppData\Local\Xamarin"

3- Build the droid project (it will take some times)

Finally, no more issues with these xamarin support packages.

Cheers UP!

like image 20
Houssam Hamdan Avatar answered Oct 19 '22 11:10

Houssam Hamdan