Xamarin Android: You are trying to install this package into a project that targets ‘MonoAndroid,Version=v2.2’

Today I created a new Xamarin Android project, and I wanted to test out Material Design on my phone (still runs 4.4.2) using the revamped AppCompat v4 library. To my disappointment I was unable to install the AppCompat NuGet package:

Turns out this can be a common problem when using Visual Studio and the “Compile using Android version” is not explicitly set. The default in my case is “Use Latest Platform”. What this does is making VS to add the proper TargetFrameworkVersion property in the .csproj file. It seems that sometimes this does not get set at all when creating a project and “Use Latest Platform” is set. Weird. In any case, setting this explicitly fixes things and NuGet understands which version of MonoAndroid to use. The default is 2.2, but we want something newer, preferably Android Version 5.

So change this:


To this:


Reload the project when asked by Visual Studio and install the package again!

Thanks to the awesome community over at the Xamarin Forums for being on top of this already — check out the post here.

UPDATE: Haha, never mind the blurred out assembly name in the first image. Don’t know why I did that đŸ˜‰

  • Lindani Vuzane

    Very helpful, i’ve been having this issue for a while. Thank you

  • Wags

    Thanks! This was driving me nuts today.

  • Matheus Guimaraes

    perfect! thanks so much!

  • Phong Yew Tong

    how do I go to this setting page?

    • Phong Yew Tong

      Ok Solved. Right Click on the android project => Options.

      • Henning M. Stephansen

        Great đŸ™‚

  • esam

    Very nice.. although in my case i had to do it manually,

    1.Unload Android Project
    2.Edit .csproject
    3.Add %Whatever version you want to target%
    4.Example : v4.1
    5.Reload project
    6.Re-add nuget package

  • Farhad Adeli

    This also happens if like me you have reinstalled windows but forget to run the Android SDK Manager for the first time to load the Available SDKs, and “Compile Using Android version:” had only one option, and the Android API levels was not listed here.
    Starting the Android SDK Manager and restarting VS fixed my problem with this error.