Can't Debug Nexus 7 After Upgrading To Xamarin 2.0

rmaciasrmacias Ruben MaciasUSMember, Beta ✭✭✭
edited March 2013 in Android

Upgraded to Xamarin 2.0 and I no longer can not debug a Nexus 7 device with Visual Studio 2012. Every time I debug, it will connect to the device, start up my app, but will crash with the stack trace listed below. This was working prior to the upgrade. I also uninstalled the shared mono for android libraries, but still have this issue. It's consistent. Build, deploy, starts up the app, and then crashes. Running the app without the debugger works as expected. It only happens when I try to attach the debugger. Any ideas?

Mono.AndroidTools.AndroidLogger Error: 0 : [E:]:                     Error in device tracker
System.AggregateException: One or more errors occurred. ---> Mono.AndroidTools.AdbException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   at Mono.AndroidTools.Adb.ReadFullAsyncResult.EndRead(IAsyncResult ar)
   at Mono.AndroidTools.Adb.AdbClient.ReadStringWithLength_OnReadLength(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token)
   at Mono.AndroidTools.Adb.AdbClient.EndReadStringWithLength(IAsyncResult asyncResult)
   at Mono.AndroidTools.TrackDeviceTask.GotString(IAsyncResult r)
   --- End of inner exception stack trace ---
---> (Inner Exception #0) Mono.AndroidTools.AdbException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   at Mono.AndroidTools.Adb.ReadFullAsyncResult.EndRead(IAsyncResult ar)
   at Mono.AndroidTools.Adb.AdbClient.ReadStringWithLength_OnReadLength(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token)
   at Mono.AndroidTools.Adb.AdbClient.EndReadStringWithLength(IAsyncResult asyncResult)
   at Mono.AndroidTools.TrackDeviceTask.GotString(IAsyncResult r)<---

Posts

  • dhindrikdhindrik Daniel Hindrikes SEMember

    I can't debug with HTC Desire after the upgrade.

  • rmaciasrmacias Ruben Macias USMember, Beta ✭✭✭
    edited March 2013

    Thanks! I went through that thread and tried a few things on there, still having the same issue.

    I also tried re-installing the Nexus driver, but that didn't help either. Though I do notice now that the stack trace has more info.

    `Mono.AndroidTools.AndroidLogger Error: 0 : [E:]: Error in device tracker System.AggregateException: One or more errors occurred. ---> Mono.AndroidTools.AdbException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult) at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) at Mono.AndroidTools.Adb.ReadFullAsyncResult.EndRead(IAsyncResult ar) at Mono.AndroidTools.Adb.AdbClient.ReadStringWithLength_OnReadLength(IAsyncResult ar) --- End of inner exception stack trace --- at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token) at Mono.AndroidTools.Adb.AdbClient.EndReadStringWithLength(IAsyncResult asyncResult) at Mono.AndroidTools.TrackDeviceTask.GotString(IAsyncResult r) --- End of inner exception stack trace --- ---> (Inner Exception #0) Mono.AndroidTools.AdbException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult) at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) at Mono.AndroidTools.Adb.ReadFullAsyncResult.EndRead(IAsyncResult ar) at Mono.AndroidTools.Adb.AdbClient.ReadStringWithLength_OnReadLength(IAsyncResult ar) --- End of inner exception stack trace --- at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token) at Mono.AndroidTools.Adb.AdbClient.EndReadStringWithLength(IAsyncResult asyncResult) at Mono.AndroidTools.TrackDeviceTask.GotString(IAsyncResult r)<---

    Mono.AndroidTools.AndroidLogger Error: 0 : [E:]: Error in device tracker System.AggregateException: One or more errors occurred. ---> Mono.AndroidTools.AdbException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult) at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) at Mono.AndroidTools.Adb.ReadFullAsyncResult.EndRead(IAsyncResult ar) at Mono.AndroidTools.Adb.AdbClient.ReadStringWithLength_OnReadLength(IAsyncResult ar) --- End of inner exception stack trace --- at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token) at Mono.AndroidTools.Adb.AdbClient.EndReadStringWithLength(IAsyncResult asyncResult) at Mono.AndroidTools.TrackDeviceTask.GotString(IAsyncResult r) --- End of inner exception stack trace --- ---> (Inner Exception #0) Mono.AndroidTools.AdbException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult) at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) at Mono.AndroidTools.Adb.ReadFullAsyncResult.EndRead(IAsyncResult ar) at Mono.AndroidTools.Adb.AdbClient.ReadStringWithLength_OnReadLength(IAsyncResult ar) --- End of inner exception stack trace --- at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token) at Mono.AndroidTools.Adb.AdbClient.EndReadStringWithLength(IAsyncResult asyncResult) at Mono.AndroidTools.TrackDeviceTask.GotString(IAsyncResult r)<---

    Mono.AndroidTools.AndroidLogger Error: 0 : [E:]: Error checking adb start-server status System.NullReferenceException: Object reference not set to an instance of an object. at Mono.AndroidTools.Internal.AdbStartWindowsServerProcess.ProcessExited(Object state, Boolean timedOut)`

  • MaximGrigoryevMaximGrigoryev Maxim Grigoryev UAMember

    Hi.

    I have the same issue - it might be some bug.

    Try to debug using Xamarin Studio - it has to work well. So it's not a device problem.

    It would be nice to hear some explanation of this error.

  • ChristopherStaerkelChristopherStaerkel Christopher Staerkel DEMember

    I have the same problem using N7 and VS2012. Tried with several projects, they work fine in Xamarin studio but crash in VS2012 on debug setting. Fun thing, it seem to work ok if I debug with my phone attached (atrix2 running on jb 4.1). I'd appreciate any insights or workarounds (besides switching to Xamarin studio)

    Thanks

  • SoftlionSoftlion Benjamin Mayrargue FRMember, Beta ✭✭

    It is because of the android 4.2.2 update. It adds a new level of security base on computer ID like SSH. Check your device, it asks you for a "debug authorization from computer ID xxxx".

    If it does not ask, open a command line on pc, go into android sdk platform tools folder, and use this command:

    adb devices

    It should show the nexus 7 as "device" and not "offline". If offline then the authorization is not accepted on the device.

    Go to the device and open the menu at the top left, or go to debug settings. Magically the authorization window should pop.

  • rmaciasrmacias Ruben Macias USMember, Beta ✭✭✭

    Thanks for the feedback. I know what you're talking about with the debug authorization and I've authorized it a while back. I did perform the adb command as you suggested. It showed it as "device" and all looked okay, but issue still persists. I do have a support ticket open. I'll let you all know if I get this resolved with them. As of now, it's still a show stopper for me.

    Thanks!

  • ChristopherStaerkelChristopherStaerkel Christopher Staerkel DEMember

    Thanks for the hint Softlion, I have downgraded my N7 to 4.12 and can debug again.

  • AndreaAntelAndreaAntel Andrea Antel ZAMember

    Any fix for this issue yet? I'm seeing the same issue with a Nexus 7 running 4.2.2 and trying to debug from VS2012. The app gets copied across to the Nexus 7 fine, starts up for a couple of seconds and then quits.

    At the time when 1st connecting the Nexus prompted me to authorize the PC which I did.

  • rmaciasrmacias Ruben Macias USMember, Beta ✭✭✭

    It was fixed when I upgraded Xamarin.Android a while ago. I think there was an update or two since then. I'm running Xamarin.Android 4.6.04000 and is still working on my end.

  • AndreaAntelAndreaAntel Andrea Antel ZAMember

    Okay, I'm currently running 4.6.0 and even though 4.6.4 seems to be the most recent stable release and I have the default setting of check for stable releases in Visual Studio I'm not being prompted to upgrade to 4.6.4. And when I select 'Check Now' for updates it also doesn't come back to prompt me to update.

  • AndreaAntelAndreaAntel Andrea Antel ZAMember

    I also have Xamarin Studio installed and used it to check for updates and it only found updates for GTK and Xamarin Studio. So I installed those and then when I checked again for updates in Xamarin Studio then it listed Xamarin.Android 4.6.4 as available.

    So it seems as if the GTK and Xamarin Studio updates were blocking the availability of Xamarin.Android 4.6.4.

    Busy downloading and installing 4.6.4 and hopefully that will fix the debugger issue with the Nexus 7.

  • AndreaAntelAndreaAntel Andrea Antel ZAMember

    Upgrading to 4.6.4 fixed the issue for me.

Sign In or Register to comment.