Bug 42914 - Visual Studio Xamarin.Android can't start debugging with Method not found error
Summary: Visual Studio Xamarin.Android can't start debugging with Method not found error
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 4.2.0 (C8)
Hardware: PC Windows
: Normal normal
Target Milestone: 4.2.1 (C8SR1)
Assignee: Bugzilla
Depends on:
Reported: 2016-07-29 09:54 UTC by Sander Schutten
Modified: 2016-11-02 17:18 UTC (History)
9 users (show)

Is this bug a regression?: ---
Last known good build:

Xamarin Logs (174.73 KB, application/x-zip-compressed)
2016-08-11 08:15 UTC, Sander Schutten

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Sander Schutten 2016-07-29 09:54:55 UTC
# Steps to reproduce
Install Alpha Preview 3 of Cycle 8 Visual Studio, open or create a Xamarin.Android project and try to debug it using the Visual Studio Emulator for Android.

# Expected behavior
The available emulators are listed in the devices dropdown. Able to pick an emulator and start debugging. Visual Studio launches the emulator.

# Actual behavior
Only the Google emulators are visible, none of Visual Studio Emulator for Android are.
Manually launching the emulator will sometimes make it show up in the dropdown, however, when launching the debug session ends abruptly with the following message in the Debug window:
Cannot start debugging: Unhandled exception while trying to connect to
Method not found: 'Void Mono.AndroidTools.AmStartCommand..ctor(System.String, System.String, System.Net.IPAddress, Int32, Int32, Boolean)'.

# Supplemental info (logs, images, videos)

# Test environment (full version information)
Microsoft Visual Studio Enterprise 2015   14.0.25424.00 Update 3
Xamarin (1b3e004)
Xamarin Inspector Support (4d868da)
Xamarin.Android (4a7d97a)
Comment 2 Juan Marcelo Tondato 2016-08-01 23:48:03 UTC
We cannot reproduce this bug.

Could you attach the VS logs (Help/Xamarin/Zip Logs last 7 days)?
Could you specify the complete reproduction steps ?
Comment 3 Sander Schutten 2016-08-04 14:42:11 UTC
Un)fortunately I'm no longer able to reproduce the issue as the emulator is working as expected after I had to repair Visual Studio and reinstall Xamarin.

After I encountered this issue I reverted to the beta channel. I must've gotten the version information after I did that. When I wanted to reproduce the issue to get the logs I updated to the Alpha channel and got into several issues where the Xamarin Visual Studio add-in packages failed to load.

This bug can be closed.
Comment 4 Sander Schutten 2016-08-11 08:15:59 UTC
Created attachment 16987 [details]
Xamarin Logs
Comment 5 Sander Schutten 2016-08-11 08:18:45 UTC
It appears this error is back again. This time on a physical Nexus 5 device running Android 6.0.0. The devices list shows the device and emulators, so I changed the title of this bug to omit that part of the error.
Comment 6 Sander Schutten 2016-08-11 08:19:41 UTC
Version info
Xamarin (f92a9da)
Xamarin Inspector Support (4d868da)
Xamarin.Android (fdaf900)
Xamarin.iOS (22921dd)
Comment 7 Jose Gallardo 2016-08-16 18:00:23 UTC
Hi Sander,

It doesn't seem to be the original bug, but something new related to missing API-levels. We're investigating the issue.
Moving it to C8SR1 for now.
We'll get back to you soon.

Thanks for reporting!
Comment 8 Juan Marcelo Tondato 2016-09-02 17:31:54 UTC

thank you for filing this bug report, we have improvements related to the missing api levels in our current public Beta bits (XVS

Please, try that version and if you are still experiencing this issue, share with us the exact reproduction steps that trigger this behavior. And if you hit it again, please upload the log files generated from "Help>Xamarin>Zip Logs” to this bug.
Comment 9 Samantha Houts [MSFT] 2016-09-19 18:55:32 UTC
I received the same error after updating to Clearing MEF cache resolved it for me.
Comment 10 Sander Schutten 2016-09-20 12:14:53 UTC
I had the same issue again with version I confirm that clearing the MEF cache did the trick. I used the following add-in to clear the cache: https://visualstudiogallery.msdn.microsoft.com/22b94661-70c7-4a93-9ca3-8b6dd45f47cd
Comment 11 Juan Marcelo Tondato 2016-09-20 14:58:46 UTC
As per comment #10, this issue was caused by the Visual Studio MEF Component Model Cache. Hence, resolving it as answered.
Comment 12 Daniel Cazzulino 2016-09-30 13:48:55 UTC
Hi there!
I've put together a build on top of current stable ( that should fix this issue: http://xvs.xamarin.com/patcheddrops/Xamarin.VisualStudio_4.2.0.698.msi

It will also be included in all future releases.

Please do reopen if you see this happen again in the future.

Thanks for reporting the issue!
Comment 13 Shruti 2016-10-13 11:24:19 UTC
I havechecked this issue as per comment12 with 
Xamarin.VisualStudio_4.2.0.698_a4b8cd89a452f9609be9dd751b6378de7f18d541 of cycle8 and Xamarin.VisualStudio_4.3.0.23_6eb7239a9a37bfe3a97e46f03a52558f2dac486c of master and not able to reproduce this issue, emulator is working as expected.

@Sander, It could be great If you please check this issue at your end with the build attached in comment12 and provide your observation.

Comment 14 Sander Schutten 2016-10-28 11:12:07 UTC
I'm currently on build that should include the fix according to Daniel. I haven't witnessed this issue anymore.
Comment 15 Shruti 2016-10-28 11:25:20 UTC
Great Thanks @Sander to verify this issue.

@Daniel, Is the fix of this commit is merged in Master?
Comment 16 Mohit Kheterpal 2016-11-02 17:18:41 UTC
As per discussion with Daniel this issue is fixed in master.

Hence, closing this issue by marking it as Verified.