Having OpenXR in your project breaks plane finding

The Magic Leap Unity SDK has a lot of OpenXR related code in it that compiles in based on the presence of the Unity OpenXR package in your project. This is done by assembly definition version defines.

Many real-world projects support multiple platforms some that support OpenXR and some that don't, so it is perfectly reasonable to have the OpenXR package in the project, but only use it on certain platforms.

From version v1.10 of the com.magicleap.unitysdk package some OpenXR plane logic was introduced. When OpenXR is included in the project this gets compiled in and replaces the non-OpenXR plane finding logic. The result is that plane finding doesn't work and you get the following error

Error: MLOpenXRCreatePlaneTracker in the Magic Leap API failed. Reason: MLResult_UnspecifiedFailure

You can work around the problem by removing the OpenXR version defines from assembly definition in a custom version of the package.

OpenXR in Unity isn't even supported by Magic Leap yet, so why is it in the package?

Even if it was supported, activating it should be based on more than just having the Unity OpenXR package in the project. Like ticking OpenXR in the XR settings, a manual define, or even better having a separate MagicLeap OpenXR package you can choose to include.

1 Like

Sorry to hear you ran into this issue and thank you for the detailed description of the issue and feedback. I have shared this with our voice of customer team.

I'm currently running into this issue as well, and I am unable to update to OpenXR, as it currently causes application-breaking conflicts with Meta (when using the Oculus plugin provider, which is required for many of Meta's features, as OpenXR is not fully supported on Meta)

Has any progress been made on fixing this issue?

@rich Do you mind creating a new topic and including more details on the errors or behavior you experience when trying to use Magic Leap OpenXR?