xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.49k stars 515 forks source link

mlaunch may try to connect to devices over wifi even for devices where wireless debugging is disabled #3446

Closed rolfbjarne closed 6 years ago

rolfbjarne commented 6 years ago

Steps to Reproduce

  1. Try to launch an app on a device with iOS 11+ or tvOS 11+ where wireless debugging is not enabled.
  2. This may happen:

    warning MT1043: Failed to launch the application using the instruments service. Will try launching the app using gdb service.
    --- inner exception
    error HE0032: Could not mount developer tools on 'iPadAir': Object reference not set to an instance of an object
    ---
    --- inner exception
    System.NullReferenceException: Object reference not set to an instance of an object
      at Xamarin.Hosting.RealDevice.ConnectToken () [0x0008a] in /work/maccore/master/maciostools/Xamarin.Hosting/Xamarin.Hosting/RealDevice.cs:100
      at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in /work/maccore/master/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2879
      at System.Threading.Tasks.Task.Execute () [0x00010] in /work/maccore/master/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2502
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /work/maccore/master/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /work/maccore/master/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /work/maccore/master/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /work/maccore/master/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
      at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in /work/maccore/master/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:113
      at Xamarin.Hosting.RealDevice+<MountDeveloperDiskImageAsync>d__125.MoveNext () [0x00054] in /work/maccore/master/maciostools/Xamarin.Hosting/Xamarin.Hosting/RealDevice.cs:623
    ---
    Launching 'com.xamarin.monotouch-test' on the device 'iPadAir'
    error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
    error HE0032: Could not mount developer tools on 'iPadAir': Object reference not set to an instance of an object

This is a random issue, sometimes it works, sometimes it doesn't (in my experience it depends on the device: on one device it happens 100% of the time, on others never).

Workaround 1: enable wireless debugging on the device. Workaround 2: cross your fingers and try again.

VS bug #581372

rolfbjarne commented 6 years ago

Reopening, still not fixed in xamarin-macios.