Bug 36178 - Unable to deploy to any Android device after updating to the new Xamarin 4 in Visual Studio
Summary: Unable to deploy to any Android device after updating to the new Xamarin 4 in...
Status: VERIFIED ANSWERED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 4.0.0 (C6)
Hardware: PC Windows
: --- normal
Target Milestone: 4.0.2 (C6SR2)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-11-23 17:49 UTC by Jon Goldberger [MSFT]
Modified: 2016-03-07 15:42 UTC (History)
10 users (show)

Tags: BZSRC6S1 , _XVS1215
Is this bug a regression?: ---
Last known good build:

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:
Status:
VERIFIED ANSWERED

Description Jon Goldberger [MSFT] 2015-11-23 17:49:55 UTC
## Description (from customer)

"I am unable to deploy my application to any android device using Visual Studio 2015 after the recent update. The build and the jarsigner complete without a problem, but after all the xml files are processed, everything just stops. The UI is responsive, but nothing happens. I waited for a long time, and then hit cancel under the build menu. This results in the following messages:
>2>Build FAILED.
>2>An error occured. See full exception on logs for more details.
>2>The given key was not present in the dictionary.

I have set output verbosity to Diagnostic, but have not gotten any more information in the build output. This solution built and ran fine on the previous version of Xamarin+Visual Studio. Are there any steps I can take to figure out what is happening? I would like to fix this rather than revert to an old version, but I can't seem to get any info on what is going wrong!"


## Notes

Based on the "The given key was not present in the dictionary," I thought it _might_ be the issue discussed on this forum thread:
https://forums.xamarin.com/discussion/54052/keynotfoundexception-using-publish-android-application-tool-from-visual-studio
the solution of which seemed to be to turn off the LLVM compiler, but this issue is occurring in Debug builds which does not allow the LLVM compiler option. 

The customer can deploy to a device in Debug from Xamarin Studio (Windows), just not from Visual Studio.

Attaching logs and more info from the customer in private comment below.
Comment 7 Jon Goldberger [MSFT] 2015-11-25 13:09:36 UTC
More info from the customer:

"Okay, I seem to have gotten past the stuck IDE. It appears that some combination of me enabling/disabling ReSharper, manually uninstalling/reinstalling the apps and the changing of the targets to Xamarin.Android from Novell.Monodroid (which happens only when you build on a Mac) have allowed me to deploy to a device immediately after a code change. Just to be clear, if I stop the app and run it again with no code change, Visual Studio hangs again and will keep doing that until I make another code change to the project. It should be noted that doing a rebuild does not fix the issue, I need to make a change in a file, something as small as just adding and removing a space."
Comment 8 Daniel Lindberg 2015-12-02 13:50:59 UTC
I am also experiencing the same issues when I deploy to Android devices.

Sometimes for me the temporary solution is to clean/rebuild solution and disconnect and reconnect the device.
Comment 9 Joakim Carselind 2015-12-02 14:08:36 UTC
Having this issue as well using Motorola TC55 and Samsung Galaxy S3.

Clean/rebuild resolves this issue sometimes and if that doesn't work uninstalling the device , usually, fix it.
Comment 10 Michael 2015-12-09 04:43:28 UTC
I have the same problem, deploying never ends.

Xamarin   4.0.0.1712 (cdc0365)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.0.35 (d300845)
Visual Studio plugin to enable development for Xamarin.Android.

Device LG Nexus 5 Android 6.0.
Comment 11 Jose Gallardo 2015-12-15 12:34:16 UTC
Looking at the logs, there was a Newtonsoft.Json versions conflict, between different installed VS extensions.

Can you please try installing the following "fixer" from VS Gallery?
https://visualstudiogallery.msdn.microsoft.com/b8f12b2c-7c3d-4269-88a7-03783ed8d51c

Please let us know if that actually resolves the issue. If it doesn't, feel free to reopen the bug.

Thanks!