1
votes

I'm working on android project, for which I'm using xamarin. So after creating a blank application which has a target version 6.0 Marshmallow, I'm trying to install Xamarin.Android.Support.Compat nuget library, but I'm getting this 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.

I don't know how to solve this issue. I'm new to mobile developing. Could anyone please help me with this issue. I'm sure I'm not the one with this issue here.

Thanks before hands.

3
have you installed build tools 24.2.* - Fahad Rehman
I've installed all the possible extensions, API's and build tools from APK manager tool :) - UnuS76
try to install the latest version nuget.org/packages/Xamarin.Android.Support.v4 and set the the Target Framework to 25 - Fahad Rehman
After following Zroq's advice, I fixed this by unloading the android project in VS solution explorer, then reloading it. Restarting VS should also work, but Zroq is also correct that the target android API version must be correct for the version of monoandroid you are trying to reference. - seljo

3 Answers

1
votes

You'll need to install API 24(7.0) and set your Droid TargetFrameworkVersion to Android 7.0 or bigger.

Read the following documentation about android versions.

1
votes

All the API version , included version 25, are installed and the Target Version is set to Android 7.0, but I'm still getting that error message.

We should always use the same API level as the version for the Support Libraries you reference, for the Xamarin.Android.Support.Compat lib version 24.2.1, it is for API level 24 (Android 7.0). We need to make sure Target Android version as well as the Compile using Android version are all set to Android 7.0 in order to install this package of version 24.2.1 or 25.1.1.

For API level 23(Android 6.0), the package version should be 23.x, but I just failed to find the package of that version.

0
votes

Restart Your Pc. It fixed for me even i was doing every thing right while installing support v7 but i was getting the same error as yours so i restarted my pc and tried installing again and it has successfully installed.