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

Scripted object (OculusXRSDKDeviceManagerProfile?) has different serialization layout when loading #10015

Closed timbrando closed 9 months ago

timbrando commented 3 years ago

Hello everyone! I get the following bug after starting my app that I deployed to HoloLens 2.

Description of the bug

After starting my app on HoloLens 2 I get the following output in the Development Console:

A scripted object (probably Microsoft.MixedReality.Toolkit.XRSDK.Oculus.Input.OculusXRSDKDeviceManagerProfile?) has a different serialization layout when loading. (Read 72 bytes but expected 116 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?

It occurs in my current project I am working at as well as in a blank new one. It's not showing in Unity Play Mode but only on HoloLens 2. Despite this error everything else works as expected.

To reproduce

Steps to reproduce the behavior:

  1. Use Unity version 2019.4.11
  2. Have a HoloLens 2
  3. Follow the steps described at https://docs.microsoft.com/en-us/windows/mixed-reality/develop/unity/tutorials/mr-learning-base-02?tabs=wsa

Expected behavior

After starting the app the development console should not appear and should not show this error.

My setup

Target platform

HoloLens 2

I hope you can reproduce and resolve this issue!

RogPodge commented 3 years ago

Unfortunately I was not able to reproduce this issue. For what it's worth, I didn't see this on 2019.4.26f1. Can you try updating your Unity version and let us know if you still see this?

2.7.1 also had some updates to various device managers, so it's possible it was fixed in the latest patch: https://docs.microsoft.com/en-us/windows/mixed-reality/mrtk-unity/release-notes/mrtk-27-release-notes?view=mrtkunity-2021-05#notable-bugfixes-and-changes

timbrando commented 3 years ago

Hi, I updated my project to Unity version 2019.4.28 (newest) and updated the MRTK to 2.7.2 but I still see this error. I also made a new blank project with this configuration and followed the steps described under the link in my initial post but nothing changed. I will try to fiddle with the OculusXRSDKDeviceManagerProfile to see if this is really the problem... Regards

RogPodge commented 3 years ago

Can you post a screenshot of where in the development console you are seeing this? I'm wondering if there's a set of warnings that we're filtering out without knowing

timbrando commented 3 years ago

IMG_20210625_081453 It is a bit tedious to get a screenshot because the HoloLens photo capture doesn't include the development console. So I made a photo with my phone through the display. I hope it helps. :)

RogPodge commented 3 years ago

Update, I've been able to find the error and will be adopting a fix based on this old PR.

https://github.com/microsoft/MixedRealityToolkit-Unity/pull/8072

This should get fixed in the next version of MRTK!

timbrando commented 3 years ago

Super cool! Thanks for the support. :) Keep up the great work!

I don't know if you still need the issue for your todo list so I will leave it to you to close this issue...

andikay commented 3 years ago

Is there any update in what version this fix will be applied? I also suffer from the same error in my HL2 project with Unity 2020.3 LTS / MRTK 2.7.0-preview5 / Windows Mixed Reality.

RogPodge commented 3 years ago

The original scope of the fix is looking a bit larger than initially forecasted unfortunately :(

Since the bug doesn't functionally affect MRTK during runtime, we've put it lower on our priority queue of issues, though be assured that it's still top of mind for us. It may need to wait until a later MRTK release however.

andikay commented 3 years ago

Thanks for the update. I don't know whether or not it impacts MRTK functionality during runtime, it is an error after all and errors in Unity often lead to something not working as desired.

Do you have any suggestion for a workaround to get rid of this error? Oculus is not really relevant for HL2 development/usage anyway.

RogPodge commented 3 years ago

Manually removing the data provider from the profile should resolve the issue: image

if there's other data providers raising an error as well, removing those should also be a good workaround.

andikay commented 3 years ago

This worked, thanks a lot!

RogPodge commented 3 years ago

Tagging related issues: https://github.com/microsoft/MixedRealityToolkit-Unity/issues/8067

spany14 commented 2 years ago

I have defaultHololens2InputSystemProfile in place but still does not solve this issue for me.

RogPodge commented 2 years ago

You have to remove the XRSDK Oculus Device Manager to remove the error. The bug is mostly harmless, it'll only show up on application start but otherwise not affect performance or the application behavior during runtime.

RaulWick commented 2 years ago

Hello, I have the same error message developing for HoloLens2, as same as @timbrando it's not showing in Unity Play Mode but only on HoloLens 2.

Unity version 2021.3.4f1 MRTK Version 2.8.0.0 Mixed Reality Feature Tool 1.0.2206.1 Preview

Same as @spany14 I have defaultHololens2InputSystemProfile in place but still does not solve this issue for me.

In my Hierarchy: Directional Light MixedRealityToolkit (DefaultHoloLens2ConfigurationProfile) MixedRealitySceneContent MixedRealityPlaysace Cube (Mesh Renderer, Box Collider, Constraint Manager, Object Manipulator, NearInteractionGrabbable, MRTK_Standard_Blue Material - Shader Mixed Reality Toolkit/Standard)

@RogPodge I can't "Remove Data Provider" for XR SDK Oculus Device Manager because the inspector is locked.

Also, the application doesn't track the position of my hands, I see my hands in front of me, but if I turn 90° my hands are now at my side

MRTK .

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 visit https://www.mixedrealitytoolkit.org.

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