Bug 37492 - Visual Studio hangs sporadically when deploying an Android app
Summary: Visual Studio hangs sporadically when deploying an Android app
Status: REOPENED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.1 (C9)
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: dean.ellis
URL:
: 38499 ()
Depends on:
Blocks:
 
Reported: 2016-01-07 21:34 UTC by Jon Goldberger [MSFT]
Modified: 2018-05-22 10:40 UTC (History)
42 users (show)

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


Attachments
Logs (7.67 KB, application/zip)
2016-01-07 21:34 UTC, Jon Goldberger [MSFT]
Details
Version info (2.90 KB, text/plain)
2016-01-07 21:35 UTC, Jon Goldberger [MSFT]
Details
callstack from debuggin session (2.22 KB, application/x-rar)
2016-02-05 16:01 UTC, Miha Markic
Details


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 for Bug 37492 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
REOPENED

Description Jon Goldberger [MSFT] 2016-01-07 21:34:54 UTC
Created attachment 14487 [details]
Logs

## Description

Visual Studio hangs sporadically when deploying an Android app. I am not able to reproduce this issue, but the reporting customer says that he is able to work around it by toggling the Fast Deployment option, i.e. if it is enable, disable it, and if it is disabled, enable it. But this is a temporary fix... the issue will occur again. 

I filed a bug the other day about an issue with the Fast Deployment option. I am not sure if it is related, but noting here in case: 
bug #37435
But in that bug, VS does not hang or freeze, just the app does not deploy. 


## Steps to reproduce 

None yet.

## Notes

I have asked for more info from the customer with regards to configurations used, devices/simulators that they are deploying to, and whether the issue is reproducible with a template app. I am awaiting that response and will add the info when I get it. 

## Log files

attached

## Version info

attached
Comment 1 Jon Goldberger [MSFT] 2016-01-07 21:35:46 UTC
Created attachment 14488 [details]
Version info
Comment 2 Jon Goldberger [MSFT] 2016-01-07 21:43:48 UTC
Additional note:

At first another support engineer thought they were hitting this bug:
bug #37435

but the description is different and that bug should be fixed in Stable according to the version numbers. 

Customer was on Stable (4.0.0.1717) when initially hitting this issue, upgraded to the Alpha (4.0.1.60) on the suggestion of this other support engineer, because they thought the fix for bug #37435 was only in the Alpha channel at that time, but the issue still remained though they reported it seemed to be less frequent. They were dealing with it. However another issue arose with the Alpha channel (bug #37429, a regression) so I suggested he go back to Stable. This is when he brought up again this issue of VS hanging/freezing on deploy, and noted that is was never fully resolved by the Alpha channel anyway.
Comment 3 Jon Goldberger [MSFT] 2016-01-07 22:26:13 UTC
Additional info from customer:

They are exclusively deploying in Debug configuration at this point and they are exclusively deploying to an embedded Android device. 

Customer also reports that they only tried this with a blank app 10 or so times and did not hit the issue with the blank app, but that does not mean that it does not happen with a blank app due to the sporadic nature of the issue. They did report going one full day without hitting the issue with his app project immediately after they downgraded back to Stable, but hit the issue first thing the next morning.
Comment 6 softlion 2016-01-22 17:08:18 UTC
+1
Debug only
From VS2015
Happens on 2 different PC.
Does not happen everytime. When it start to happens, it happens every time.
Restarting adb does not help.
Changing the deployment target fix this.
Maybe a caching bug of fast deployment ?

The deploymnent process always stop at the same position:

1>Project "Ac.Plugins.Settings.csproj" (GetBuiltProjectOutputRecursive target(s)):
1>Done building project "Ac.Plugins.Settings.csproj".
1>Done building project "Ac.Shared.csproj".
[DEPLOYMENT HANGS HERE]

[WHEN IT WORKS, THESE LINES ARE DISPLAYED]
1>Building target "_ConvertPdbFiles" partially, because some output files are out of date with respect to their input files.
1>Building target "_CopyMdbFiles" partially, because some output files are out of date with respect to their input files.
...
Comment 7 Jonathan Pryor 2016-01-28 15:03:36 UTC
What's needed is:

1. A consistent repro, and
2. When it hangs, what's it doing?

(2) will involve full diagnostic output for both the "works" and "fails" scenarios: hopefully a diff in the two will point out where things go bad.

What might also be helpful is Process Explorer/etc. output: what processes are running, what's (presumably?) waiting for input. In particular, what's the MSBuild.exe process doing? (Assuming there *is* a separate MSBuild process when the IDE is involved; I'm not sure how that works. Perhaps the VS process needs to be checked?)

One plausible scenario is that the `adb` connection is just "hanging", not doing anything, and restarting `adb` might fix things. Perhaps try disconnecting the device and then reconnecting it, and restart adb?

https://developer.xamarin.com/guides/android/troubleshooting/troubleshooting/#IDE_does_not_display_target_device
Comment 8 softlion 2016-01-28 15:42:54 UTC
I dont have a repro. It does hang once every 3/5 deployments.

When it hangs, it is waiting for the build to finish. You can only cancel the build. cancelling the build works. Deploying after cancelling the build does work 9 times/10.


WHEN IT WORKS, THESE LINES ARE DISPLAYED:

1>Building target "_ConvertPdbFiles" partially, because some output files are out of date with respect to their input files.
1>Building target "_CopyMdbFiles" partially, because some output files are out of date with respect to their input files.

When it does not work, after cancelling it just display "build cancelled" and deployment failed.
Comment 9 Daniel Cazzulino 2016-01-28 18:13:42 UTC
I'd also suggest (since the ratio of failure seems to be pretty high, 3/5) to open the same solution in XS on Windows and see if the same hangs can be reproduced, just to discard anything that VS might be doing specially (we normally don't, we just call the MSBuild targets)
Comment 10 Peter Collins 2016-01-28 20:11:53 UTC
I was unable to reproduce this using a shared forms solution with the mono shared runtime and fastdev enabled for the Android project. I deployed to a device and emulator 10 times while occasionally making minor code changes in between deployment attempts.

When you say that VS is 'hanging' do you mean that the build/deploy process appears to be 'stuck' or that the IDE is actually not responding to input?

I'm also unclear on the target device in this case - whether it's an emulator, physical hardware, or some combination of both in which this behavior is encountered.

If at all possible could someone please attach a solution which reproduces this (even if not with 100% frequency)?
Comment 11 Miha Markic 2016-02-05 15:48:43 UTC
Can repro this on a solution with android and pcl projects.
The build process would hang on random project like described above (i.e. after Done build XY).
Canceling build process works albeit it might take tens of seconds to actually cancel.
Doesn't happen with XS at all.

Will try to gather more info. Any idea what should I look for?
Comment 12 Miha Markic 2016-02-05 16:01:59 UTC
Created attachment 14916 [details]
callstack from debuggin session

Here is the probably culprit that hangs.
Comment 13 Cody Beyer (MSFT) 2016-02-05 22:52:12 UTC
*** Bug 38499 has been marked as a duplicate of this bug. ***
Comment 17 Przemysław Raciborski 2016-02-19 09:34:13 UTC
This bug is seen really often when platform project references few PCL projects.
Comment 18 daume.dennis 2016-04-13 14:48:21 UTC
I can reproduce this everytime, if "Fast Deployment" is enabled, both in the latest Stable and Beta releases
Comment 19 daume.dennis 2016-04-13 14:50:12 UTC
Additional info:

It works fine in Xamarin Studio. Visual studio completely freezes and is unresponsive for all user interactions, to the point where I have to kill it via the task manager
Comment 20 Seb 2016-05-17 15:14:48 UTC
VS2015 - Xamarin 4.0.4.4 - Xamarin Android 6.0.4.0:
In my case a Clean of at least one project is only way to deploy unless I have a code change. 
It occurs consistently if VS doesn't have to build any of my projects prior to deploying for Debug.
Comment 21 Ken Domino 2016-05-20 18:36:06 UTC
I am also experiencing this problem, consistent with all above comments. Builds work fine; deploy does not, causing VS to hang. Hangs on any Windows, even on a clean laptop (after 3+ hours just to install VS--unacceptable). When I cancel the deploy, VS then becomes unresponsive to any mouse clicks. Using SysInternals Process Monitor, aapt.exe is never called during the deployment. Completely unacceptable, totally blocking because I cannot execute my Android app, as Xamarin Studio is going away on Windows. I really don't want to become a Mac user, but will switch from Windows to Mac just so I can get work done in Xamarin Studio.
Comment 22 Ken Domino 2016-05-20 20:15:05 UTC
I have made some headway into a workaround. In VS, under Tools->Options->Projects and Solutions->Build and Run, set "maximum number of parallel project builds" to 1. By default, it is 4. The result is that the build works consistently, deterministically, and does not hang. Off the hook for now, but *PLEASE* do not get rid of XS on Windows.
Comment 23 Mark A 2016-05-27 20:59:53 UTC
I believe that I am the one that originally reported this bug, and I just wanted to clarify that for me, I have never had my VS become unresponsive. The build process just hangs, but as soon as I cancel the build, it always comes back. In fact that is basically my normal workflow now, I click start, it hangs, I cancel the build, toggle the fast deploy option, then click start again.

As others have mentioned, our solution does have a number of PCLs and Shared Projects.

I have tried many times to create a solution that can reproduce this, aside from our production code, and have been unsuccessful.
Comment 24 Sergey Metlov 2016-06-05 10:47:19 UTC
Exactly the same periodically reproduces for me. I noticed the problem occurs most often in the following scenario:
1. Clean the solution.
2. Run the app in Debug Mode (F5).
3. Stop debugging.
4. Repeat steps 2-3 multiple times.
5. Run the app without debugging (Ctrl+F5).
6. Run the app with Debug again.
Result: VS hangs on deploying. Building seems to be finished correctly. UI doesn't block, but deploying is in progress forever.

It doesn't matter if I run the app on the physical device or the emulator.

The following workaround works for me:
1. Stop deploying by Ctrl+Break.
2. Clean the Android project.
3. Uninstall the app from the device.
4. Run the app again.

Microsoft Visual Studio Community 2015
Version 14.0.25123.00 Update 2
Xamarin 4.0.3.214 (0dd817c)
Xamarin.Android
Version: 6.0.3.5 (a94a03b)
Comment 25 till 2016-07-06 08:22:49 UTC
Occures on 2nd build on an Android solution.

last build output:
Project "XXX.csproj" (GetBuiltProjectOutputRecursive target(s)):
Done building project "XXX.csproj".

Then it hangs and I have to cancel the build. Next build succeeds.

This is my installation of VS:

Microsoft Visual Studio Enterprise 2015
Version 14.0.25421.03 Update 3
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA514
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Visual Basic 2015   00322-80000-00000-AA514
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA514
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA514
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-80000-00000-AA514
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   7.0.20622.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

AutoHistory   1.0
Information about my package

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GhostDoc   4.9.15086.0
GhostDoc automatically generates XML documentation comments.

GitFlow.VS.Extension   1.0
Visual Studio extension that integrates GitFlow

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JetBrains ReSharper Ultimate 2015.2   Build 103.0.20150818.200216
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.

Microsoft Azure HDInsight HQL Service   2.0.2600.0
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio   2.0.2600.0
An integrated development environment for HDInsight application development.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.7
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.7.30818.1601

Mobilize.NET's Windows Bridge for WP Silverlight   1.0
Extension used to convert Windows Phone Silverlight project to the Universal Windows Platform.

Multilingual App Toolkit   3.1.1250.0
Multilingual App Toolkit helps you localize your Windows Store app by providing file management, pseudo and machine translation, translation editor, and build integration. http://go.microsoft.com/fwlink?linkid=245767

NuGet Package Manager   3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Compact & SQLite Toolbox   4.6.0
SQL Server Compact & SQLite Toolbox adds scripting, import, export, rename, query execution and much more to SQL Server Compact & SQLite Data Connections.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

TypeScript   1.8.34.0
TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.25420.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.1.1.3 (34a92cd)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.1.1.1 (7db2aac)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   9.8.1.4 (3cf8aae)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 27 apujadas 2016-08-04 17:17:26 UTC
Things got working as expected when set the number of parallel builds to 1 as this comment stated:

https://bugzilla.xamarin.com/show_bug.cgi?id=37492#c22
Comment 28 Paul Roy 2016-09-08 16:24:35 UTC
Despite setting my "maximum number of parallel project builds" to 1, I still have this issue.

It only happens on physical devices, not on emulators.
Comment 29 Paul Roy 2016-09-08 16:27:34 UTC
During the build, it freezes at the end of « Synchronizing assemblies » :
Copying application to device...
10% ... 896kb of 8324kb copied
20% ... 1728kb of 8324kb copied
30% ... 2560kb of 8324kb copied
40% ... 3392kb of 8324kb copied
50% ... 4224kb of 8324kb copied
60% ... 5056kb of 8324kb copied
70% ... 5888kb of 8324kb copied
80% ... 6720kb of 8324kb copied
90% ... 7552kb of 8324kb copied
100% ... 8324kb of 8324kb copied
Getting installation path...
Using fast dev path: /storage/emulated/0/Android/data/com.xxx.xxx/files/.__override__
Synchronizing assemblies...
0% ... 64kb of 20031kb copied
10% ... 2017kb of 20031kb copied
20% ... 4067kb of 20031kb copied
30% ... 6028kb of 20031kb copied
40% ... 8067kb of 20031kb copied
50% ... 10045kb of 20031kb copied
60% ... 12077kb of 20031kb copied
70% ... 14038kb of 20031kb copied
80% ... 16041kb of 20031kb copied
90% ... 18034kb of 20031kb copied


And nothing happens next.
Comment 30 solarisx 2016-12-07 14:21:37 UTC
Setting "maximum number of parallel project builds" to 1 does not work. Still have this issue. Any news on this matter?
Comment 31 Daniel Cazzulino 2016-12-29 20:01:34 UTC
Based on Paul Roy's comment, this seems like an XA issue, since VS doesn't synchronize files explicitly, it's all done by the underlying MSBuild targets.

Also, for some users, disabling fastdev seems to fix it, again pointing at something outside of the VS extension realm.

Moving to the XA component.
Comment 32 Jahmai 2017-03-17 07:03:22 UTC
Happening here too, disabling FastDev doesn't fix it for me. Only trying the build again and sometimes restarting visual studio helps.
Comment 33 Mark A 2017-03-17 15:34:12 UTC
I never noticed this before, but today when my project hung, a line like:

1>Could not write lines to file "obj\Debug\Project_A.csproj.FileListAbsolute.txt". The process cannot access the file 'C:\workspace\Project\Project_A\obj\Debug\Project_A.csproj.FileListAbsolute.txt' because it is being used by another process.

for most of the projects in my solution.
Comment 34 Jahmai 2017-03-17 22:46:46 UTC
Yes I have those log lines too. Haven't paid attention whether they exist on a successful build, but they are definitely there on a hung build.
Comment 35 Eli Black 2017-04-13 06:46:31 UTC
I'm seeing the same/similar symptoms as Paul Roy. Oddly enough, in my case I think it tried to deploy the Mono framework twice and then hung.

Enabling Fast Deployment let me deploy once, then hung again.

Output:

1>Detecting installed packages...
1>Removing old runtime: Mono.Android.DebugRuntime...
1>Target device is arm64-v8a.
1>Installing the Mono shared runtime (debug - 1487348814)...
1>10% ... 4160kb of 41407kb copied
1>20% ... 8320kb of 41407kb copied
1>30% ... 12480kb of 41407kb copied
1>40% ... 16576kb of 41407kb copied
1>50% ... 20736kb of 41407kb copied
1>60% ... 24896kb of 41407kb copied
1>70% ... 28992kb of 41407kb copied
1>80% ... 33152kb of 41407kb copied
1>90% ... 37312kb of 41407kb copied
1>100% ... 41407kb of 41407kb copied
1>Removing old runtime: Mono.Android.DebugRuntime [2147483647]..
1>Removing old runtime: Mono.Android.Platform.ApiLevel_24 [2147483647]..
1>Target device is arm64-v8a.
1>Installing the Mono shared runtime (debug - 1487348814)...
1>0% ... 64kb of 41407kb copied
1>10% ... 4160kb of 41407kb copied
1>20% ... 8320kb of 41407kb copied
1>30% ... 12544kb of 41407kb copied
1>40% ... 16576kb of 41407kb copied
1>50% ... 20736kb of 41407kb copied
1>60% ... 24896kb of 41407kb copied
1>70% ... 29056kb of 41407kb copied
1>80% ... 33152kb of 41407kb copied
1>90% ... 37312kb of 41407kb copied
1>100% ... 41407kb of 41407kb copied



Interestingly enough, after that, it looks like it's trying to install the Mono shared runtime twice:

1>Target device is arm64-v8a.
1>Installing the Mono shared runtime (debug - 1487348814)...
1>10% ... 4160kb of 41407kb copied
1>20% ... 8320kb of 41407kb copied
1>30% ... 12480kb of 41407kb copied
1>40% ... 16576kb of 41407kb copied
1>50% ... 20736kb of 41407kb copied
1>60% ... 24896kb of 41407kb copied
1>70% ... 28992kb of 41407kb copied
1>80% ... 33216kb of 41407kb copied
1>90% ... 37312kb of 41407kb copied
1>100% ... 41407kb of 41407kb copied
1>Removing old runtime: Mono.Android.DebugRuntime [2147483647]..
1>Target device is arm64-v8a.
1>Installing the Mono shared runtime (debug - 1487348814)...
1>0% ... 64kb of 41407kb copied
1>10% ... 4160kb of 41407kb copied
1>20% ... 8320kb of 41407kb copied
1>30% ... 12480kb of 41407kb copied
1>40% ... 16576kb of 41407kb copied
1>50% ... 20736kb of 41407kb copied
1>60% ... 24896kb of 41407kb copied
1>70% ... 28992kb of 41407kb copied
1>80% ... 33216kb of 41407kb copied
1>90% ... 37312kb of 41407kb copied
1>100% ... 41407kb of 41407kb copied


then it hangs.
Comment 36 soorosh_abi@hotmail.com 2017-05-26 15:32:39 UTC
ITNOA

Hi,

I think this problem maybe related to Bug 50354 - Deployment stuck at zipalign.exe
Comment 37 Paul Sinnema 2017-07-06 13:49:03 UTC
The process hangt at the following line:

Detecting installed packages...
DEBUG RunShellCommand 1015faeb8a312a02 am broadcast -a "mono.android.intent.action.PACKAGE_VERSIONS" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_25,nl.natuurnetwerk.notifier" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions"

I've issued the command to the phone using the following:

adb shell am broadcast -a "mono.android.intent.action.PACKAGE_VERSIONS" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_25,nl.natuurnetwerk.notifier" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions"

Response was:

Broadcasting: Intent { act=mono.android.intent.action.PACKAGE_VERSIONS cmp=Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions launchParam=MultiScreenLaunchParams { mDisplayId=0 mFlags=0 } (has extras) }

.. and nothing more.
Comment 38 Paul Sinnema 2017-07-06 14:10:50 UTC
Issueing the same command on an J5 Android (6.0.1) phone (mine is a S6 (7.0)) I get the following response:

Broadcast completed: result=0, data="Mono.Android.DebugRuntime=1495644436,Mono.Android.Platform.ApiLevel_25=1496391872,"

It looks like a problem on the phone itself and not something of Visual Studio 2017 (althought it would be good to timeout after a while with a useful error message).
Comment 39 Paul Sinnema 2017-07-06 14:39:49 UTC
Shutting my phone down (not restarting). Waiting a while and starting it solved this problem (until it happens again of course).
Comment 40 Paul Sinnema 2017-07-10 13:50:44 UTC
Well, today it happened again and this time it persists. I cannot deploy to my S6 anymore. I'm now using the J5. It looks like it got worst after the update to Android 7.0. Anyone else having this frustrating problem? Any solutions?
Comment 41 Mathias Karner 2017-07-28 11:41:09 UTC
I also experienced this problem. It seems this comment describes a working workaround (sequential build of projects in solution): https://bugzilla.xamarin.com/show_bug.cgi?id=37492#c22
Comment 42 Nuno Henrique 2017-11-01 12:04:46 UTC
Happening to me on VS for Mac after the latest stable update, every 10 builds or so. Have to re-open VS to make it working again.
Comment 43 Mark Downes 2017-11-03 14:19:03 UTC
VS 2015 on Windows freezes every time that I do a Clean on the solution.
Comment 45 gtezini 2017-12-15 13:04:05 UTC
Thank you Ken Domino, your suggestion in the comment 22 worked!
Comment 46 ruthj180 2018-03-23 18:52:54 UTC
FYI. I have recently installed Visual Studio 2017 Professional. I am experiencing this hanging issue when trying to deploy an Android app with Visual Studio to the Android emulator. The following series of steps is working for me as a workaround to deploy the app into the emulator.

Start VS Professional 2017 Version 15.6.3
Open Xamarin Android solution // Starts adb.exe
Run solution (F5)
Emulator starts then app starts
Close app in emulator from Overview // this step may not always be required
Close emulator
toggle fast deploy
Shut down VS 2017
Kill adb.exe in task manager
-repeat for each deploy-

It seems like doing a "cold" start of adb.exe is necessary. If I stop adb.exe while VS 2017 is running, a background process will restart it and I do not get the same results (ability to deploy app)

Here are Xamarin versions:

Xamarin - 4.9.0
Xamarin Designer - 4.10
Xamarin.Android SDK - 8.2.0
Xamarin.iOS and Xamarin.Mac SDK 11.8.1

Hope this helps to resolve this issue.
Comment 47 Jassim 2018-05-22 10:40:29 UTC
I have the same problem