Xamarin Android (Visual Studio 2015) Could not connect to the debugger

12,416

Solution 1

I had same issue and I was able to connect debugger by following this:

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

In short:

  • Disable "Use fast deployment (debug mode only)" in Android project -> Properties -> Android options -> Packaging

  • Enable "Migrate to a physical computer with a different processor version" in Hyper-V manager go to VM -> Settings -> Processor -> Compatibility

Solution 2

For me, this turns out to be an issue of DELL laptop running on Windows 10, after I rolled back to Windows 8.1, it works fine now

Solution 3

Error accepting stdout and stderr (127.0.0.1:8896) Address already in use

This has been reported to Xamarin as Bug 34476.

Share:
12,416
Khang Tran
Author by

Khang Tran

Updated on June 14, 2022

Comments

  • Khang Tran
    Khang Tran almost 2 years

    I have a problem with the android debugger (Visual Studio 2015) as it always stops immediately after starting debug (it works just fine without debugging), I had my machine reset and reinstalled Visual Studio 2015 but it does not help.

    Here is the log from logcat: monodroid-debug Error accepting stdout and stderr (127.0.0.1:8896) Address already in use

    Here is the log from Xamarin log:

    Mono.Debugging.Soft.ConnectionException: Could not connect to the debugger. ---> Mono.Debugger.Soft.VMDisconnectedException: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.
    
    Server stack trace: 
    at Mono.Debugger.Soft.Connection.SendReceive(CommandSet command_set, Int32 command, PacketWriter packet)
    at Mono.Debugger.Soft.Connection.VM_GetVersion()
    at Mono.Debugger.Soft.Connection.Connect()
    at Mono.Debugger.Soft.VirtualMachine.connect()
    at Mono.Debugger.Soft.VirtualMachineManager.Connect(Connection transport, StreamReader standardOutput, StreamReader standardError)
    at Mono.Debugger.Soft.VirtualMachineManager.ConnectInternal(Socket dbg_sock, Socket con_sock, IPEndPoint dbg_ep, IPEndPoint con_ep)
    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
    at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
    
    Exception rethrown at [0]: 
    at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
    at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
    at Mono.Debugger.Soft.VirtualMachineManager.ConnectCallback.EndInvoke(IAsyncResult result)
    at Mono.Debugger.Soft.VirtualMachineManager.EndConnect(IAsyncResult asyncResult)
    at Mono.Debugging.Soft.SoftDebuggerSession.<>c__DisplayClass9.b__8(IAsyncResult ar)
    --- End of inner exception stack trace ---
    

    Any help is much appreciated!