问题
I'm developing a Xamarin Forms application(currently only Android support). The default setup set TargetFramework to 7.1. The minimum android version for this project must be 7.0. This produces a warning:
The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.Android.dll (vv7.1) is greater than the $(TargetFrameworkVersion) for your project (v7.0). You need to increase the $(TargetFrameworkVersion) for your project. It seems natural to me, to compile for the version that you will be using. Is that not the case?
This articles recommends to always compile with the latest version. Is there any benefit to compiling with the latest version for my application? https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/android-api-levels?tabs=vswin#framework
回答1:
This answer is for Visual Studio 2017. If you are using Xamarin Studio for mac, then you have to look for similar option.
The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.Android.dll (vv7.1)
It means, the project is using SDK 7.1 i.e. Xamarin.Forms.Platform.Android.dll (vv7.1) but you had selected Compile Using Android Version (Target Framework) lower than that in the project setting.
So keep Android 7.1 Nougat to compile your project. You can set this from Project Properties >> Application menu
The minimum android version for this project must be 7.0.
By this if you mean, the minimum Android OS version on which you want to make your App available, then that has to be set from -
Project Properties >> Android Manifest >> Minimum Android Version dropdown
For more details - refer below link
https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/android-api-levels?tabs=vswin
来源:https://stackoverflow.com/questions/49831364/xamarin-choosing-targetframework-and-minimumandroidversion