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

**URL:** <https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525>\
**Category:** Mobile\
**Tags:** unreal-engine, Android, UE4-27, question\
**Created:** [May 18, 2022, 7:39pm UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525 "2022-05-18T19:39:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_MI8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Matt\_MI8](https://forums.unrealengine.com/u/Matt_MI8)\
**Post date:** [May 18, 2022, 7:39pm UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525/1 "2022-05-18T19:39:39Z")

</div>

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.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/b/dcbe2f7428d0bc73140cd6296ba90f5322e1ad13.png)

---

<div class="post-metadata">

**Author:** ![dev.ue.games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dev.ue.games/32/466816_2.png) [@dev.ue.games](https://forums.unrealengine.com/u/dev.ue.games)\
**Post date:** [May 19, 2022, 1:44am UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525/2 "2022-05-19T01:44:00Z")

</div>

![UE4Editor_1kHGo54yhQ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/b/56be30c13a479c073a8b7e3a7af40ba9bcabc830.png)  
 ![UE4Editor_Y9F5Fys73u](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/9/4298731e0cbdb7dcce52111d51bad1046749040a.png)  
I’m not sure what set of plugins you have but I turned Oculus VR on and packed the apk

---

<div class="post-metadata">

**Author:** ![dev.ue.games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dev.ue.games/32/466816_2.png) [@dev.ue.games](https://forums.unrealengine.com/u/dev.ue.games)\
**Post date:** [May 19, 2022, 12:41pm UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525/3 "2022-05-19T12:41:52Z")

</div>

show your version of ndk and java

---

<div class="post-metadata">

**Author:** ![Matt\_MI8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Matt\_MI8](https://forums.unrealengine.com/u/Matt_MI8)\
**Post date:** [May 19, 2022, 1:16pm UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525/4 "2022-05-19T13:16:01Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/a/1/ba18721862e72d3a840596623bbf09d1bdb8ff1b.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/c/05caea78eb98e2b33f8f6af75422c671987119c2.png)

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

---

<div class="post-metadata">

**Author:** ![dev.ue.games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dev.ue.games/32/466816_2.png) [@dev.ue.games](https://forums.unrealengine.com/u/dev.ue.games)\
**Post date:** [May 19, 2022, 1:34pm UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525/5 "2022-05-19T13:34:36Z")

</div>

try this version

 ![UE4Editor_MjiRjlTjVI](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/9/649bcefaa0e9df288aa419ee75a6bcc77c63324e.png)

---

<div class="post-metadata">

**Author:** ![Matt\_MI8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Matt\_MI8](https://forums.unrealengine.com/u/Matt_MI8)\
**Post date:** [May 19, 2022, 2:11pm UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525/6 "2022-05-19T14:11:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dev.ue.games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dev.ue.games/32/466816_2.png) [@dev.ue.games](https://forums.unrealengine.com/u/dev.ue.games)\
**Post date:** [May 19, 2022, 2:12pm UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525/7 "2022-05-19T14:12:58Z")

</div>

> [@Matt\_MI8](#):
>
> manually install

 ![Screenshot_24](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/a/2aa297500da06a490e61e8bdc31a3cee6f7cb968.jpeg)

---

<div class="post-metadata">

**Author:** ![dev.ue.games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dev.ue.games/32/466816_2.png) [@dev.ue.games](https://forums.unrealengine.com/u/dev.ue.games)\
**Post date:** [May 19, 2022, 2:15pm UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525/8 "2022-05-19T14:15:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Matt\_MI8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Matt\_MI8](https://forums.unrealengine.com/u/Matt_MI8)\
**Post date:** [May 19, 2022, 3:06pm UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525/9 "2022-05-19T15:06:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Matt\_MI8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Matt\_MI8](https://forums.unrealengine.com/u/Matt_MI8)\
**Post date:** [June 1, 2022, 2:38pm UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525/10 "2022-06-01T14:38:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Astrotronic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astrotronic/32/1194566_2.png) [@Astrotronic](https://forums.unrealengine.com/u/Astrotronic)\
**Post date:** [June 1, 2022, 6:08pm UTC](https://forums.unrealengine.com/t/ue4-android-packaging-for-quest-2-fails-with-the-oculus-vr-plugin-enabled/560525/11 "2022-06-01T18:08:59Z")

</div>

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. 🙂 Cheers.
