How to build an OpenXR APK for the Quest 2?

So I’m struggling with building an APK, from Unity 2020.3, for the Quest 2, using OpenXR. Every method I’ve tried produces a black screen with 3 dot’s. The official Unity documentation listed here, states " At this time, deploying directly to Oculus Quest/Quest 2 is not supported." but I’ve heard that some people have managed to build an OpenXR app directly to the Quest headset.

I myself haven’t been able to successfully create a native OpenXR APK directly to the Quest 2. I tried using the default File → Build Settings → Switch to Android Platform → and then Build and Run, but when the app opens on the headset, the screen is black and frozen with 3 white dots. I try to exit the app from the Oculus Menu, but it won’t display, so I have to restart the headset.

Then I tried building the APK using the Oculus menu by going to Oculus → Tools → OpenXR (Experimental) → Activate Oculus Utilities Plugins with OpenXR. Someone on twitter advised me this is what I needed to do. Once I chose this option I then went to Oculus → OVR Build → OVR Build APK and Run. But that is always inconsistent in building the actual APK and running. When it did manage to run, I had the same problem. The screen was black and frozen with 3 whites dots.

Has anyone successfully created an OpenXR APK with Unity for the Quest 2? I can run the Unity Editor with the Quest 2, using Link as PCVR just fine. But I want to be able to deploy directly to the headset as a native APK with OpenXR.

I’ve been able to build my APK from Unity to the Quest 2 without issues, I’m struggling to get the APK to pass validation in app lab however (says Unity VR support is not enabled, this option does not exist in Unity 2020.3 when using OpenXR).

Can Unity see your device in the list of build targets? Do you have XR Enabled for Android in player settings? I also found I had to have it enabled for PC with initialize on Startup checked in order to test in the editor on the headset.

I haven’t tried using the oculus tools to actually do the build, I build directly from normal build window with Unity.

Silly question but do you have the proper scene selected in build settings? Sounds like it could be opening an empty scene.

Thanks for the reply. I can definitely see my device. And I can push the APK to the device. If I was using the normal Oculus API for the camera rig, it works fine. But I’m trying to implement OpenXR.

As a test I tried to build the controller sample scene to the headset, but once its loaded and running, everything freezes.

I do have Initialize XR on Startup checked for both the Android and PC and I do have the correct scene loaded in the build settings. I’m not sure what it is I’m missing. Are you working with OpenXR or are you using the current OVR Api?

I was able to build directly to the headset using OpenXR and Unity’s regular build window. When trying to get it ready for the store I added the oculus integration, which I apparently did not have somehow (thought I had to do that when I set up the OpenXR profile). Now Unity does not want to connect directly and if I build an APK locally and then sideload it I get the three dots you describe.

After rolling back my changes I was able to get the APK building again, for some reason when I add the oculus integration it breaks Unity’s adb, but I can build locally and sideload and the app runs.

This didn’t help with my issue (APK Validation), but might help you…

Basically lets the OVR Plugin know your using OpenXR

The recent Oculus v31 release had a conflict with version 1.2.3. of the OpenXR plugin. We released a 1.2.8 version today that should fix that issue, maybe try that and see if the original problem goes away.