Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin choosing TargetFramework and MinimumAndroidVersion

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

like image 472
Justas S Avatar asked Apr 14 '18 12:04

Justas S


People also ask

How do I change my target version in xamarin?

Go to android project then right click -> Properties -> Android Manifest (scroll down) then you will see Minimun android version and Target android version. Save this answer.

What does Target API level mean?

Each app specifies a targetSdkVersion (also known as the target API level) in the manifest file. The target API level indicates how your app is meant to run on different Android versions.

Which API target the framework and application developers?

Xamarin. Android exposes three Android API level project settings: Target Framework – Specifies which framework to use in building your application. This API level is used at compile time by Xamarin.


1 Answers

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). May be you had selected Compile Using Android Version (Target Framework) lower than v7.1 in the project setting.

If you set Android 7.1 Nougat to compile your project it will work. You can set this from Project Properties >> Application menu

The minimum android version for this project must be 7.0.

This means the minimum Android OS version on which you want to make your App available.

This can 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

like image 85
GauravKP Avatar answered Sep 20 '22 02:09

GauravKP