Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Forms Deployment Fails After Update

After updating Xamarin from visual studio , Xamarin.Forms application gives this exception when running

System.MissingMethodException: Method Android.Support.V4.Widget.DrawerLayout.AddDrawerListener not found

I did try to update the Nuget Packages, re-install Xamarin for visual studio, re-install android sdk, no thing worked .

How can I solve it ?

like image 768
Muhammad Charaf Avatar asked Sep 24 '16 02:09

Muhammad Charaf


2 Answers

Maybe you have updated packages Android.Support.xxxx. Try it:

  1. Uninstall the Xamarin Forms packages and all the android support packackage.
  2. Reinstall just the latest Xamarin Forms Nuget package. Letting it grab the Android support packages. Ignore any Android.Support.xxxx updates.
like image 134
FetFrumos Avatar answered Oct 04 '22 10:10

FetFrumos


So I just reproduced your issue and I am sorry that you and other ran into this. It looks like there was an issue in the templates and I am working with the team to quickly resolve this.

To fix:

  • Simply right click on the android project and select "Manage Nuget Packages"
  • Go to Updates
  • Find Xamarin.Android.Support.v7.AppCompat
  • Select version 23.3.0 from the version picker and hit Install
  • You additionally will need to install the RecyclerView 23.3.0 NuGet Package. * Go to Browse and search for: Xamarin.Android.Support.v7.RecyclerView and make sure to pick 23.3.0 to install for the correct version
  • Now do a full clean/rebuild and it should work

This should install the correct versions of everything you need for Android

Optionally, you can select just Xamarin.Forms and update to the latest version on ALL projects and it should update all references that it needs.

like image 45
JamesMontemagno Avatar answered Oct 04 '22 11:10

JamesMontemagno