lrefopam
lrefopam

Reputation: 531

Xamarin.Forms Android $(TargetFrameworkVersion) error

I upgraded Xamarin.Forms in my old project to v4.5.0.495. When I try to start my app in an Android simulator, I receive the following error:

XF005: The $(TargetFrameworkVersion) for App.Android (v8.1) is less than the minimum required $(TargetFrameworkVersion) for Xamarin.Forms (9.0). You need to increase the $(TargetFrameworkVersion) for App.Android. (XF005)

After this, I increased the version in the project options to Android 10.0 (API level 29), but the error occurs again. VS is up to date. Has anyone experienced the same error?

Upvotes: 20

Views: 21197

Answers (4)

I had to manually change the references to the TargetFrameworkVersion in the csproj file to get it to update properly. For some reason there were several references to this value in the .csproj file, all with different values!

Upvotes: 1

Chitu
Chitu

Reputation: 373

I resolved by adding making below settings under Android Project-->Properties and changing target versions Application Settings Android Manifest Settings

Upvotes: 2

zar
zar

Reputation: 12227

I was getting this error message:

error XF005: The $(TargetFrameworkVersion) for TripLog2.Android (v9.0) is less than the minimum required $(TargetFrameworkVersion) for Xamarin.Forms (10.0). You need to increase the $(TargetFrameworkVersion) for TripLog2.Android.

Going to Android project properties, I had two new versions available in target framework. They both has * sign next to them which means they require update.

I pcked the latest which was 11 but that created another set of errors. However Selecting version 10 worked. I did had to quit Visual Studio 2019 and restart it for my project to build fine again. Without it, error will not go away.

enter image description here

Upvotes: 0

WMartin
WMartin

Reputation: 619

Posting this as an answer for other people since I almost missed it in the comments. Credit to @FreakyAli

Right-click on Android Project>Properties>Application>Compile using Android version change this to v9 or above and see if that works

On VS Mac it can be found on the General section. (right click android project>Options>General)

Upvotes: 34

Related Questions