UE4 Android Packaging for Quest 2 Fails with the Oculus VR plugin enabled

Has anyone else run into this or found a solution?

I was packing to the Quest 2 just fine until I enabled the Oculus VR plugin within Unreal Engine 4.27.2. (I wanted access to the hand tracking.) With the plugin enabled all of my packages and launches to the quest fail. If I turn the plugin off it all works fine again.

It looks like the Oculus VR plugin is causing gradle errors.

Any help is much appreciated.



I’m not sure what set of plugins you have but I turned Oculus VR on and packed the apk

show your version of ndk and java


It looks like I have JAVA_VERSION=“1.8.0_242” I believe this just came with the Android Studio install. I found this in the C:\Program Files\Android\Android Studio\jre
This directory was set by Android Studio

try this version

Would I need to manually install that by downloading that version through Oracle? Or is that hiding somewhere in the Unreal / Android studio setup?

but it will not guarantee you to fix the error)) I just included this plugin and packed the apk without errors … so if you install that java you a chance that everything will work

Thanks! I will give it a try and report back.

So it looks like turning off the OpenXR plugin allowed me to package again. Although I don’t understand why.

Hi Matt,

As to your question ‘Why?’:

In your log I’m seeing “variable x is already defined” so, I’d guess that these variables are getting defined in both the Oculus plugin and the OpenXR plugin and that this sort of conflict will trigger errors.

We’re all dreaming of a future where OpenXR is the only plugin we’ll need. :slight_smile: Cheers.