Search Unity

Bug DllNotFoundException: UnityOpenXR when trying to run deviceless on Mac

Discussion in 'VR' started by laurie71, Jan 31, 2022.

  1. laurie71

    laurie71

    Joined:
    Aug 15, 2018
    Posts:
    41
    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:<unknown assembly> type:<unknown 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)
     
  2. laurie71

    laurie71

    Joined:
    Aug 15, 2018
    Posts:
    41
    Bump. Anyone have any ideas on this?
     
  3. Tanya_Li

    Tanya_Li

    Unity Technologies

    Joined:
    Jun 29, 2020
    Posts:
    105
    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: 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.
     
  4. laurie71

    laurie71

    Joined:
    Aug 15, 2018
    Posts:
    41
    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?
     
    xinaesthete likes this.
  5. JorisEertink

    JorisEertink

    Joined:
    Mar 15, 2017
    Posts:
    24
    @laurie71 did you get any solution for this? I am facing the same or similar problems.
     
  6. RGUnity

    RGUnity

    Joined:
    Jan 16, 2017
    Posts:
    1
    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.
     
  7. dboscombe_unity

    dboscombe_unity

    Joined:
    Sep 17, 2021
    Posts:
    1
    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.
     
    jonowo likes this.
  8. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,085
    Where or how do you remove it for Mac
     
    DENKUNDMACH likes this.
  9. Railon23

    Railon23

    Joined:
    Jan 30, 2014
    Posts:
    32