HoloLensWithOpenCVForUnityExample icon indicating copy to clipboard operation
HoloLensWithOpenCVForUnityExample copied to clipboard

NullReferenceException error within WindowsMixedRealityToolkit

Open yllew opened this issue 5 years ago • 1 comments

I followed the setup instructions 1-7. Then, I connected my Hololens through Window > XR > Holographic Emulation > "Remote to Device". However, when I press Play in Unity, it seems that the application is not connected to Hololens and instead access my PC's webcam. The following NullReferenceException error occurs.

NullReferenceException: Object reference not set to an instance of an object Microsoft.MixedReality.Toolkit.WindowsMixedReality.WindowsMixedRealityCameraSettings.InitializeReprojectionUpdater () (at Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealityCameraSettings.cs:101) Microsoft.MixedReality.Toolkit.WindowsMixedReality.WindowsMixedRealityCameraSettings.Enable () (at Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealityCameraSettings.cs:46) Microsoft.MixedReality.Toolkit.BaseDataProviderAccessCoreSystem.Enable () (at Assets/MixedRealityToolkit/Services/BaseDataProviderAccessCoreSystem.cs:39) Microsoft.MixedReality.Toolkit.CameraSystem.MixedRealityCameraSystem.Enable () (at Assets/MixedRealityToolkit.Services/CameraSystem/MixedRealityCameraSystem.cs:154) Microsoft.MixedReality.Toolkit.MixedRealityToolkit+<>c.<EnableAllServices>b__62_0 (Microsoft.MixedReality.Toolkit.IMixedRealityService service) (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:934) Microsoft.MixedReality.Toolkit.MixedRealityToolkit.ExecuteOnAllServices (System.Collections.Generic.IEnumerable1[T] services, System.Action1[T] execute) (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:1024) Microsoft.MixedReality.Toolkit.MixedRealityToolkit.ExecuteOnAllServicesInOrder (System.Action`1[T] execute) (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:1010) Microsoft.MixedReality.Toolkit.MixedRealityToolkit.EnableAllServices () (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:934) Microsoft.MixedReality.Toolkit.MixedRealityToolkit.OnEnable () (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:620)

I've searched around and most solutions suggest fixing NullReferenceException error by changing the script contents but I am not sure if I am supposed to do that since the scripts are downloaded as a part of Microsoft's Mixed Reality Toolkit. Any ideas on how to fix this problem? I am trying to get the app to run on the Hololens instead of using my PC's Webcam.

yllew avatar Jan 17 '20 09:01 yllew

I have tested this example only with editor and device installation. Not tested with Holographic Emulation.

EnoxSoftware avatar Jan 18 '20 10:01 EnoxSoftware