问题
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.
回答1:
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.
回答2:
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!
回答3:
The solution:
- Try to update your xamarin visual Studio after you will install it and you will get monoandroid v7
- update your android sdk Api 24 or api 25
I think it will help you.
回答4:
I removed from the Android SDK all API dependencies 23, ie Android 6.0 and installed from 7.0 and 7.1 (AP 24 and 25).
Clean and Rebuild the project.
Done that, it worked correctly. Hope this helps.
来源:https://stackoverflow.com/questions/40308329/cannot-install-xamarin-android-support-v4