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
5.99k stars 2.12k forks source link

Register Problems for Providers like Unable to register IMixedRealityInputDeviceManager data provider #9722

Closed powerschaf closed 3 years ago

powerschaf commented 3 years ago

Describe the bug

I tested several MRTK 2.6.1 profiles in Unity 2020.3.6f1 but every time there are issues with registering providers, i also made custom profiles to fix that but at runtime i get other errors like:

WindowsMixedRealityDeviceManager has not set a value for IsEnabled, returning false. UnityEngine.Debug:Assert (bool,string).

(even the provider is attached correctly now).

To reproduce

Steps to reproduce the behavior:

  1. Create a new Unity project
  2. Use MixedRealityFeatureTool to import Mixed Reality Toolkit Foundation 2.6.1 (i also tried with Extension, Exampeles, OpenXR Plugin etc. , this does not make a difference)
  3. Go to build settings and switch plattform to Universal Windows Plattform
  4. Go to Project Settings ->XR Plug-in Management -> Install XR Plug-In Management and make sure "Windows Mixed Reality" is checked under Plug-in Providers
  5. Add Mixed Reality Toolkit to Scene (here i tried different profiles and custom profiles)
  6. Run Application (errors are shown)

Expected behavior

The Game runs without errors

Screenshots

Settings: settings2 settings1

DefaultMixedRealityToolkitConfigurationProfile: DefaultMixedRealityToolkitConfigurationProfile

Errors: ErrorMessages1

DefaultHoloLens2ConfigurationProfile: DefaultHoloLens2ConfigurationProfile

Errors ErrorsDefaultHoloLens2ConfigurationProfile

DefaultHoloLens2XRSDKConfigurationProfile -> No Errors by attaching but at runtime Errors

So now to fix the errors from the DefaultMixedRealityToolkitConfigurationProfile for example i cloned the profile and added the correct files, Unity showes me where something went wrong: DataProviderFix

And fixed it seems fine and the error disappears: DataProviderFixDone

So i fixed everything but if i run this application now, several errors are shown: Errors

Can anybody help me out ?

Your setup (please complete the following information)

Target platform (please complete the following information)

Additional context

Add any other context about the problem here.

powerschaf commented 3 years ago

Well ladys and gents it seems, that i found a kind of hacky soloution which should be documentated for folks or the root problem should be fixed within next updates.

So first if you have any kind of unregistered providers click Copy & Customize in the MRTK inspector section to enable customization possibility: CpyCustomize

Give it a name like whatever you want and click clone: CpyCustomize2

Now it depends on your registration errors which section you have to enter and edit to get everithing correctly attached, for example: ErrMessage

You have to search the Device Manager in the MRTK settings, in this case it is in the section Input -> Input Data Providers (just click the "try repair" button at the right side or search manually by clicking the red dropdown) : TryRepair

So now the error message should be gone in the Unity Console Window, do that for all errors. Let's continue to the interesting part because if you run the application now it seems to be totaly broken and more messages appear. First go to the Project Settings into the PC,Mac & Linux Standalone section and Check the following Box: FixErrorsComplete

Then run the application you might get a message from windows that the app cannot be started but ignore that. After that you should uncheck the Windows Mixed Reality support again for PC,Mac & Linux Standalone if you want to develop for UWP.

So now eveything should work without errors, don't ask me why you have to activate the Mixed Reality Provider for Standalone once even you make a UWP App. Seems to be a Problem from Unitys side. I hope i can help you out.

laultman commented 3 years ago

I had the same issue using the World Lock Tool with MRTK in 2020.3.7. The @powerschaf fixed the errors for me.

keveleigh commented 3 years ago

If you're using XR Plugin Management / XR SDK in a version of MRTK prior to 2.7.0-preview.4, the DefaultMixedRealityToolkitConfigurationProfile is not the correct profile to use, as it only supports legacy XR (which Unity removed in Unity 2020). You can find more information about the correct profiles at https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/configuration/getting-started-with-mrtk-and-xrsdk.

Starting with 2.7.0-preview.4, you can start using DefaultMixedRealityToolkitConfigurationProfile again, as we've updated profiles to support both of Unity's XR pipelines.

Going to close this as a combination of "by design" in pre-Unity 2.7.0-preview.4 (alternate profiles are provided to support XR Plugin Management / XR SDK) and "fixed" in Unity 2.7.0-preview.4+ as we decided to change direction to make things less confusing and easier to configure.

powerschaf commented 3 years ago

@keveleigh Yeah you are absolutly right. I use the DefaultHololens2XRSDKConfigurationProfil now and the DefaultXRSDKCameraProfil . Otherwise i get Problems with 2D frozen Holografic View.

andikay commented 3 years ago

I am having the same or very similar issue with HL2 builds with Uniy 2020.3 LTS / MRTK 2.7.0-preview5 / Windows XR Plugin. I do not have any errors or warnings when testing it in the Unity Editor, only on the final HL2 build. I do not have anything that needs repairing in the MRTK, so I cannot apply any of the fixes/workarounds mentioned in this topic. Here are the WARNINGS (not ERRORS according to Unity debugging console) I get:

Unable to register IMixedRealityInputDeviceManager data provider (Windows Mixed Reality Device Manager) because the value concreteType is null.
This may be caused by code being stripped during linking. The link.xml file in the MixedRealityToolkit.Generated folder is used to control code preservation.

Unable to register IMixedRealityInputDeviceManager data provider (Windows Mixed Reality Eye Gaze Provider) because the value concreteType is null.
This may be caused by code being stripped during linking. The link.xml file in the MixedRealityToolkit.Generated folder is used to control code preservation.

Unable to register IMixedRealityInputDeviceManager data provider (Windows Mixed Reality Spatial Mesh Observer) because the value concreteType is null.
This may be caused by code being stripped during linking. The link.xml file in the MixedRealityToolkit.Generated folder is used to control code preservation.

The result of these warnings is that I cannot move or look around in the application on the HL2 at all. In the Unity Editor these warnings do not exist and I can move around with WASD and look around with holding RMB.

I have tried using the DefaultMixedRealityTooklitConfigurationProfile as well as the DefaultHoloLens2ConfigurationProfile and the same is true for the Input system configuration profile, it did not change anything except that the third warning only occurs with the HL2 profiles I believe.