microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

Opening EyeTrackingDemo-00 for the first time throws a NullReferenceException #8623

Closed elbuhofantasma closed 9 months ago

elbuhofantasma commented 4 years ago

Describe the bug

When opening the EyeTrackingDemo-00-RootScene for the first time in UWP, the Scenes In Build will populate with the scenes that are in the MRTK Examples Hub, and the console will output a NullReferenceException.

To reproduce

Steps to reproduce the behavior:

  1. Import the Foundation, Examples, and Extensions .unitypackage to a new UWP project.
  2. Open Assets/MRTK/Examples/Demos/EyeTracking/Scenes/EyeTrackingDemo-00-RootScene
  3. Navigate to the Unity Console and see the error.

Expected behavior

Opening the Eye Tracking Demo will not cause a NullReferenceException.

Screenshots

EYETRACKING

Your setup (please complete the following information)

Additional context

Opening scene 'Assets/MRTK/Examples/Demos/EyeTracking/Scenes/EyeTrackingDemo-00-RootScene.unity'
Unloading 5 Unused Serialized files (Serialized files now loaded: 0)
Loaded scene 'Assets/MRTK/Examples/Demos/EyeTracking/Scenes/EyeTrackingDemo-00-RootScene.unity'
    Deserialize:            35.882 ms
    Integration:            59.875 ms
    Integration of assets:  0.051 ms
    Thread Wait Time:       23.262 ms
    Total Operation Time:   119.070 ms
System memory in use before: 160.1 MB.
System memory in use after: 132.2 MB.

Unloading 4318 unused Assets to reduce memory usage. Loaded Objects now: 4501.
Total: 28.149300 ms (FindLiveObjects: 1.453200 ms CreateObjectMapping: 0.417100 ms MarkObjects: 10.450500 ms  DeleteObjects: 15.827700 ms)

NullReferenceException: Object reference not set to an instance of an object
  at Microsoft.MixedReality.Toolkit.Extensions.SceneTransitions.SceneTransitionService.Initialize () [0x00001] in D:\20200921.4\extensionsimporttest\Assets\MRTK\Extensions\SceneTransitionService\SceneTransitionService.cs:96 
  at Microsoft.MixedReality.Toolkit.MixedRealityToolkit+<>c.<InitializeAllServices>b__63_0 (Microsoft.MixedReality.Toolkit.IMixedRealityService service) [0x00000] in D:\20200921.4\extensionsimporttest\Assets\MRTK\Core\Services\MixedRealityToolkit.cs:994 
  at Microsoft.MixedReality.Toolkit.MixedRealityToolkit.ExecuteOnAllServicesInOrder (System.Action`1[T] execute) [0x00038] in D:\20200921.4\extensionsimporttest\Assets\MRTK\Core\Services\MixedRealityToolkit.cs:1109 
  at Microsoft.MixedReality.Toolkit.MixedRealityToolkit.InitializeAllServices () [0x00011] in D:\20200921.4\extensionsimporttest\Assets\MRTK\Core\Services\MixedRealityToolkit.cs:994 
  at Microsoft.MixedReality.Toolkit.MixedRealityToolkit.InitializeServiceLocator () [0x005a1] in D:\20200921.4\extensionsimporttest\Assets\MRTK\Core\Services\MixedRealityToolkit.cs:523 
  at Microsoft.MixedReality.Toolkit.MixedRealityToolkit.InitializeInstance () [0x0002b] in D:\20200921.4\extensionsimporttest\Assets\MRTK\Core\Services\MixedRealityToolkit.cs:639 
  at Microsoft.MixedReality.Toolkit.MixedRealityToolkit.RegisterInstance (Microsoft.MixedReality.Toolkit.MixedRealityToolkit toolkitInstance, System.Boolean setAsActiveInstance) [0x000e5] in D:\20200921.4\extensionsimporttest\Assets\MRTK\Core\Services\MixedRealityToolkit.cs:789 
  at Microsoft.MixedReality.Toolkit.MixedRealityToolkit.get_Instance () [0x0004f] in D:\20200921.4\extensionsimporttest\Assets\MRTK\Core\Services\MixedRealityToolkit.cs:614 
  at Microsoft.MixedReality.Toolkit.MixedRealityToolkit+EditorEventListener+<>c.<.cctor>b__1_1 () [0x00063] in D:\20200921.4\extensionsimporttest\Assets\MRTK\Core\Services\MixedRealityToolkit.cs:1524 
  at UnityEditor.EditorApplication.Internal_CallHierarchyHasChanged () [0x00024] in <8004fcc221b54f98ba547350ea71d812>:0 

(Filename: Assets/MRTK/Extensions/SceneTransitionService/SceneTransitionService.cs Line: 96)

Launched and connected shader compiler UnityShaderCompiler.exe after 0.04 seconds
Launched and connected shader compiler UnityShaderCompiler.exe after 0.04 seconds
Launched and connected shader compiler UnityShaderCompiler.exe after 0.04 seconds
Launched and connected shader compiler UnityShaderCompiler.exe after 0.07 seconds
<RI> Initialized touch support.
david-c-kline commented 4 years ago

On investigation with @elbuhofantasma, it appears that this occurs when the min SDK version is set to 18362 (have not tested other beyond 10240). In this situation, the error is triggered by the scene transition extension service not having the profile correctly configured (as shown in the following image).

image

Setting the profile should resolve the issue.

Further investigation is needed to root cause this,

david-c-kline commented 4 years ago

addressing with a release note for 2.5.0

stale[bot] commented 2 years ago

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

IssueSyncBot commented 9 months ago

We appreciate your feedback and thank you for reporting this issue.

Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.

Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.

Please note that MRTK3 was released in August 2023. It features an all new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visithttps://www.mixedrealitytoolkit.org.

Thank you for your continued support of the Mixed Reality Toolkit!