DllNotFoundException: UnityOpenXR when trying to run deviceless on Mac

,

So the goal was to get a project set up using OpenXR and the XRI device simulator to allow for play-in-editor testing and debugging as I'm working on Mac and thus can't use on-device PIE.

To test this out, I created a fresh project in Unity 2020.3.26f1 (tried with 2021.2.7f1 with the same result) with the following packages:

  • OpenXR Plugin 1.3.1
  • Oculus XR Plugin 1.11.2
  • XR Plugin Management 4.2.1
  • XR Interaction Toolkit 2.0.0-pre.6

  • Default Input Actions sample imported

  • XR Device Simulator imported

I included the Oculus XR Plugin so that I could still deploy to the device as well as run in editor (since I'm ultimately targeting Quest devices). I configured XR Plug-in Management to target the OpenXR provider for standalone (PC/Mac/Win) and Oculus for Android, and configured the OpenXR provider to use the Oculus Touch Controller Profile on both standalone and Android.

After setting up the XRI input mappings, I created a scene with a simple ground plan, an XRRig (Action Based) and an XR Device Simulator and hit play, and got the error below. I get the same error even with a completely empty scene, so it's apparently not triggered by the XR rig or device simulator prefabs.

Here's the Unity 2021.2.7f1 version of the error:

DllNotFoundException: UnityOpenXR assembly: type: member:(null)
UnityEngine.XR.OpenXR.OpenXRLoaderBase.Initialize () (at Library/PackageCache/com.unity.xr.openxr@1.3.1/Runtime/OpenXRLoader.cs:177)
UnityEngine.XR.Management.XRManagerSettings.InitializeLoaderSync () (at Library/PackageCache/com.unity.xr.management@4.2.1/Runtime/XRManagerSettings.cs:190)
UnityEngine.XR.Management.XRGeneralSettings.InitXRSDK () (at Library/PackageCache/com.unity.xr.management@4.2.1/Runtime/XRGeneralSettings.cs:175)
UnityEngine.XR.Management.XRGeneralSettings.AttemptInitializeXRSDKOnLoad () (at Library/PackageCache/com.unity.xr.management@4.2.1/Runtime/XRGeneralSettings.cs:148)

Bump. Anyone have any ideas on this?

MacOS is not supported for Playmode and Standalone build.
If you were targeting OpenXR, make sure you check OpenXR Project Validation (Window -> XR-> OpenXR-> Project Validation) and resolve any issues/warnings before build or run.
In your case, it must show errors like screenshot below: 7863010--998530--upload_2022-2-2_14-44-35.png

On Mac, you could target Android platform with OpenXR, just the same as with Oculus XR plugin.

[quote=“Tanya_Li”, post:3, topic: 870248]
MacOS is not supported for Playmode and Standalone build.
If you were targeting OpenXR, make sure you check OpenXR Project Validation (Window → XR-> OpenXR-> Project Validation) and resolve any issues/warnings before build or run.
In your case, it must show errors like screenshot below:

On Mac, you could target Android platform with OpenXR, just the same as with Oculus XR plugin.
[/quote]

I am targeting Android, which allows me to build and run on device. That works, but it’s slow and doesn’t allow me to debug via VS Code. What I’d like to be able to do is to run in editor in play mode with simulated hardware, which is what I thought the XR Device Simulator was for.

Does Unity not support the OpenXR stack on Mac at all? If not, is there a way I can at least conditionally disable OpenXR if I’m testing UI or other systems that don’t need HMD and controller input?

1 Like

[quote=“laurie71”, post:4, topic: 870248]
I am targeting Android, which allows me to build and run on device. That works, but it’s slow and doesn’t allow me to debug via VS Code. What I’d like to be able to do is to run in editor in play mode with simulated hardware, which is what I thought the XR Device Simulator was for.

Does Unity not support the OpenXR stack on Mac at all? If not, is there a way I can at least conditionally disable OpenXR if I’m testing UI or other systems that don’t need HMD and controller input?
[/quote]

@laurie71 did you get any solution for this? I am facing the same or similar problems.

[quote=“JorisEertink”, post:5, topic: 870248]
@laurie71 did you get any solution for this? I am facing the same or similar problems.
[/quote]
Also interested in this. I have Oculus building fine other than that error. It will still run in the editor with that error. This is on a macbook pro M1. I’ve tried both silicon and intel Unity Editors.

I have had issues with having both the XR Interaction Toolkit and the Oculus Integration Asset installed. I had to remove the Oculus Integration Asset to get it to work correctly. I have the XR Interaction set to OpenXR, and the OpenXR set up to support the Quest which seems to make Unity happy.

1 Like

Where or how do you remove it for Mac

1 Like

This helped me to fix the error right now in the new 'mixed reality' example project from Unity:
https://forum.unity.com/threads/dllnotfoundexception-unitymockhmd.1314600/#post-8339382