androidxamarinvisual-studio-2015drawerlayoutactionbardrawertoggle

Visual Studio 2015 - Adding Android Support Library v4 and v7 to use DrawerLayout and ActionBarDrawerToggle


I am trying to add these 2 support libraries to my project through Nuget Manager in Visual Studio in order to be able to use DrawerLayout and ActionBarDrawerToggle. However, both libraries are failing to install with the same error:

*****Could not install package 'Xamarin.Android.Support.Compat 24.2.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', 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.***** (the screenshot of the error is also provided at the bottom)

Below are screenshots for these 2 libraries as shown in VS2015 Nuget Package Manager:

Xamarin.Android.Support.v4

enter image description here

Xamarin.Android.Support.v7.AppCompat v 24.2.1

enter image description here

I have installed SDK Platforms in my Android SDK Manager from API19 to API25 and in Extras, I have both Android Support Repository and Android Support Library as can be seen below: enter image description here

And I have installed Android SDK Tools, Platform-tools and Build-tools from 19 to 25.2.2:

enter image description here

Once I select to install these 2 libraries to my project and hit OK on Review Changes dialog and Licence Acceptance dialog, the installation fails with error like below:

enter image description here


Solution

  • It appears that all I needed to do is to restart my Visual Studio.