Bug 34476 - Android app crashes on the startup VS Android emulator when built with Debug config
Summary: Android app crashes on the startup VS Android emulator when built with Debug ...
Status: RESOLVED ANSWERED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 4.0.0 (C6)
Hardware: PC Mac OS
: Normal major
Target Milestone: 4.3.1 (C9SR1)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-10-01 02:00 UTC by Prashant Cholachagudda
Modified: 2016-12-29 17:47 UTC (History)
13 users (show)

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


Attachments
adb log (285.53 KB, text/plain)
2015-10-01 02:00 UTC, Prashant Cholachagudda
Details
complete logs (32.76 KB, application/x-zip-compressed)
2015-12-24 00:57 UTC, Jimmy [MSFT]
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 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:
RESOLVED ANSWERED

Description Prashant Cholachagudda 2015-10-01 02:00:09 UTC
Created attachment 13154 [details]
adb log

Android app crashes on the startup VS Android emulator when built with Debug config.
Looks like the debugger crashes because its trying to open a port that is being used

09-24 11:31:40.396 W/monodroid-debug( 1934): Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8807,server=y,embedding=1
09-24 11:31:40.400 W/monodroid-debug( 1934): Accepted stdout connection: -1
09-24 11:31:40.400 F/monodroid-debug( 1934): Error accepting stdout and stderr (127.0.0.1:8808): Address already in use

Note that port number changes with each execution of VS.

# Version Information
-------------------------

Microsoft Visual Studio Professional 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00079

Installed Version: Professional

Visual Basic 2015 00322-40000-00000-AA707
Microsoft Visual Basic 2015

Visual C# 2015 00322-40000-00000-AA707
Microsoft Visual C# 2015

Visual C++ 2015 00322-40000-00000-AA707
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU 00322-40000-00000-AA707
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package 1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 14.0.20711.0
ASP.NET and Web Tools

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

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

GenerateUnitTest 1.0
Generates unit test code for methods in classes under test.

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

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

Office Developer Tools for Visual Studio 2015 ENU 14.0.23025
Microsoft Office Developer Tools for Visual Studio 2015 ENU

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

SQL Server Data Tools 14.0.50730.0
Microsoft SQL Server Data Tools

Visual Studio Tools for Universal Windows Apps 14.0.23121.00 D14OOB
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.

Workflow Manager Tools 1.0 1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin 3.11.837.0 (f10676f)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android 5.1.5.3 (f98871a95a479f6d71b3067b7e5834d41fcb2118)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS 8.10.4.0 (6db87c53c073f4af2f5247fb738a27ea08c094fd)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration 1.0
Automated migration for Xamarin iOS Classic projects to Unified

Xamarin.TestCloud.Integration 1.0
Early preview of Xamarin Test Cloud integration
Comment 3 Jimmy [MSFT] 2015-12-24 00:57:52 UTC
Created attachment 14399 [details]
complete logs

I have a customer experiencing this issue and I can reproduce it on my end as well. This is with the latest stable version 4.0.0.1717.

This is happening with a brand new Android project and since the first debugging session. And I can manually open the app on the emulator without any crash.

I've attached logcat, build, and VS logs to the report. The machine's version info is below. I also have another Windows system with VS2015 Update 1 and Xamarin installed that does not hit this issue.


### Environment Info
Microsoft Visual Studio Professional 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01038

Installed Version: Professional

Visual Basic 2015   00322-40000-00000-AA558
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA558
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA558
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-40000-00000-AA558
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11106.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.30624.0
For additional information, visit http://www.asp.net/

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

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.3.0
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 Data Tools   14.0.50616.0
Microsoft SQL Server Data Tools

TypeScript   1.7.4.0
TypeScript for Microsoft Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.24720.00
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.0.0.1717 (1390b70)
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.

Xamarin.iOS   9.3.99.33 (ea30b32)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 4 Jimmy [MSFT] 2015-12-24 00:58:50 UTC
Bug 35849 might also be related to this.
Comment 6 Todd Aspeotis 2016-01-22 01:17:52 UTC
Is there any workaround for this?
Comment 7 Tibor Tóth 2016-01-25 13:25:17 UTC
This bug was reported presently 4 month ago, and no workaround and no fix.
Comment 9 Tibor Tóth 2016-02-22 11:50:17 UTC
Much thanks to @LocalJoost to find a workaround for this bug.

http://dotnetbyexample.blogspot.hu/2016/02/fix-for-could-not-connect-to-debugger.html

In some words:
- Disable "Use fast deployment" in "project properties / Android options / Packaging"
- Go to Hyper-V manager and open VM's settings
- Enable "Migrate to a physical computer with a different processzor version" in "Processor / Compatibility"
Comment 10 Mikayla Hutchinson [MSFT] 2016-07-29 19:42:13 UTC
Please do NOT disable fast deployment. See this for an explanation: http://dotnetbyexample.blogspot.com/2016/02/fix-for-could-not-connect-to-debugger.html?showComment=1456157131581#c7911271169893965195
Comment 11 Jose Gallardo 2016-12-27 21:41:56 UTC
Bumping the target milestone to C9SR1 to get more visibility and focus on the investigation.
Thanks.
Comment 12 Juan Marcelo Tondato 2016-12-29 17:47:24 UTC
This is actually an issue on the device configuration and not in our product. The explanation is the one provided on Comment 10 link (http://dotnetbyexample.blogspot.com/2016/02/fix-for-could-not-connect-to-debugger.html?showComment=1456157131581#c7911271169893965195) by Mikayla.
Resolving it as “Answered”.
Thanks!