Trying to port an existing HoloLens 2 Unity application to the Magic Leap 2 by following the online guide but getting some errors when building. Before following the guide, I verified that the app deploys successfully to the HoloLens 2 with the Unity and MRTK versions listed below.
Library\PackageCache\com.microsoft.mixedreality.toolkit.foundation@f2323a9b7aec\Providers\OpenXR\Scripts\OpenXRControllerModelProvider.cs(8,30): error CS0234: The type or namespace name 'OpenXR' does not exist in the namespace 'Microsoft.MixedReality' (are you missing an assembly reference?)
Library\PackageCache\com.microsoft.mixedreality.toolkit.foundation@f2323a9b7aec\Providers\OpenXR\Scripts\OpenXRControllerModelProvider.cs(29,26): error CS0246: The type or namespace name 'ControllerModel' could not be found (are you missing a using directive or an assembly reference?)
The Magic Leap Tool Setup is also all in green. I've also added a URP Asset (with Universal Renderer), assigned it, and upgraded the MRTK shader to it, as shown in the guide instructions.
Any ideas what is missing that is causing the OpenXRControllerModelProvider.cs errors?
Unfortunately the com.microsoft.mixedreality.toolkit.foundation.OpenXRControllerModelProvider is not maintained by Magic Leap so our knowledge is limited about the topic. You might want to reach out on the MRTK github to see if they can assist.
You may also want to quit your project and then delete the Library folder inside of the project. Then re-open the project and set the build platform to Android to see if that clears it up. You might also want to check if removing the #MSFT_OPENXR definition from your project settings also helps.
Thanks for the reply, kbabilinkski. I will go and ask there and see if they have any tips.
Do you know by any chance what is the OpenXRControllerModelProvider used for? The project I am trying to port is a small one with a simple scene to see what the porting process is like (we're thinking of migrating other projects to ML2).
To be honest, I couldn't find where it is being defined. The only place I saw references to it is in the Library directory, but that is auto generated. I guess I could find where it is defined there and remove it. Is that what you mean?
It is also possible to add to the built-in selection of #define directives by supplying your own. Open the Other Settings panel of the Player settings and navigate to the Scripting Define Symbols text box.
See more information here:
MRTK might provide instructions on how to revert your project from Microsoft open XR
When I upgraded to MRTK 2.8.3, I didn't realize there was another package under the Platform Support category called Mixed Reality OpenXR Plugin. Updating that to the latest version fixed those errors.