How do I fix a timeout error deploying to a physical Apple Watch?

EasyGoingPatEasyGoingPat GBMember ✭✭✭

I keep getting a timeout error every time I try to deploy my application to a physical Apple Watch. I don't know if the log errors shown below are the cause. Does anyone have any clue what they are telling me?

Xamarin.Inspector|Information|0|Inspector extension loaded
Xamarin.Inspector|Error|0|[Inspector] Error preparing project for inspection
System.NullReferenceException: Object reference not set to an instance of an object.
   at Xamarin.VisualStudio.Inspector.VSInspectorSession.Create(Project proj, IServiceProvider serviceProvider) in E:\A\_work\25\s\src\Features\VisualStudio.Inspector\Vsix\VSInspectorSession.cs:line 54
   at Xamarin.VisualStudio.Inspector.XamarinInspectorPackage.RefreshInspectorSession() in E:\A\_work\25\s\src\Features\VisualStudio.Inspector\Vsix\XamarinInspectorPackage.cs:line 166
Xamarin.Inspector|Error|0|[Inspector] Error preparing project for inspection
System.NullReferenceException: Object reference not set to an instance of an object.
   at Xamarin.VisualStudio.Inspector.VSInspectorSession.Create(Project proj, IServiceProvider serviceProvider) in E:\A\_work\25\s\src\Features\VisualStudio.Inspector\Vsix\VSInspectorSession.cs:line 54
   at Xamarin.VisualStudio.Inspector.XamarinInspectorPackage.RefreshInspectorSession() in E:\A\_work\25\s\src\Features\VisualStudio.Inspector\Vsix\XamarinInspectorPackage.cs:line 166
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Server State transition from DisconnectedState to ConfiguringState on MacBook (192.168.0.2)
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Checking host configuration for connecting to 'MacBook'...
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Checking SSH configuration...
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Checking Mono installation...
Xamarin.Messaging.Ssh.SshCommandRunner|Warning|0|Failed to execute 'which mono64': ExitStatus = 1

Any help would be greatly appreciated.

Kind wishes ~ Patrick

Best Answer

  • EasyGoingPatEasyGoingPat GB ✭✭✭
    Accepted Answer

    Working with Michael Clemens from Microsoft, the Apple Watch connection is now possible. It can still be tediously fragile but I can get it to work. The workaround solution appears to be this:

    1. Power up PC, Mac and iPhone but leave Watch off.
    2. Turn off wifi on iPhone. (Yes, you read that right! Disable the wifi connection on your iPhone.)
    3. Ensure the option to debug over wifi is disabled in Visual Studio on PC and in XCode on the Mac.
    4. Plug the iPhone into the Mac via USB.
    5. Now power-on the Watch (note I did this with the Watch off power cradle then placed it on cradle; not sure if this matters)
    6. Wait until the Watch appears with its full name in Devices and Simulators in XCode.
    7. Back in VS on PC, disconnect and reconnect the Mac.

    Watch now appears as a run-target and works.

Answers

  • JesperBollingJesperBolling BRMember ✭✭

    Same here:

    Xamarin.Inspector|Information|0|Inspector extension loaded
    Xamarin.Inspector|Error|0|[Inspector] Error preparing project for inspection
    System.NullReferenceException: Object reference not set to an instance of an object.
    at Xamarin.VisualStudio.Inspector.VSInspectorSession.Create(Project proj, IServiceProvider serviceProvider) in E:\A_work\5\s\src\Features\VisualStudio.Inspector\Vsix\VSInspectorSession.cs:line 54
    at Xamarin.VisualStudio.Inspector.XamarinInspectorPackage.RefreshInspectorSession() in E:\A_work\5\s\src\Features\VisualStudio.Inspector\Vsix\XamarinInspectorPackage.cs:line 166

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @JesperBolling

    I'd love to help, but, unfortunately, since I posted that, I have gone backwards with this. I now can't even get an application to attempt a deployment to a physical Apple Watch because it doesn't appear as a debug target.

    So far I am finding WatchOS development in Xamarin on the PC to be impossible. Even the supplied Xamarin example 'Hello World' application doesn't work. (And before anyone suggests it, I do have my Provisioning set correctly, which only took two weeks before a patch from Xamarin finally fixed it.)

    If anyone from Xamarin is reading this, sorry for my negativity. I want to love Xamarin because it promises to be the best cross-platform development, allows me to work in C# and I hate working on Macs, but so far it is proving to be impossible. I'm going to have to consider alternatives soon unless I can get this working. I might even have to learn Swift. :(

    • Patrick
  • EasyGoingPatEasyGoingPat GBMember ✭✭✭
    Accepted Answer

    Working with Michael Clemens from Microsoft, the Apple Watch connection is now possible. It can still be tediously fragile but I can get it to work. The workaround solution appears to be this:

    1. Power up PC, Mac and iPhone but leave Watch off.
    2. Turn off wifi on iPhone. (Yes, you read that right! Disable the wifi connection on your iPhone.)
    3. Ensure the option to debug over wifi is disabled in Visual Studio on PC and in XCode on the Mac.
    4. Plug the iPhone into the Mac via USB.
    5. Now power-on the Watch (note I did this with the Watch off power cradle then placed it on cradle; not sure if this matters)
    6. Wait until the Watch appears with its full name in Devices and Simulators in XCode.
    7. Back in VS on PC, disconnect and reconnect the Mac.

    Watch now appears as a run-target and works.

Sign In or Register to comment.