0

I am using Unity 2020.3.37f1 and I am generating a multiplayer application that can communicate both in VR and in desktop/conventional mode, I have the scene change programmed depending on the platform it is on, my main problem is that I think the apks generated for Quest have some type of extra information in the Manifest or Oculus libraries in general that prevent their execution on a mobile device since I tried to make it work on my phone (Oppo Find X5 Pro with Android 13) and after the Unity logo simply it closes but in Quest 2 it works perfectly.

Does anyone know what steps to follow when developing an application like this? In the case that it was not possible from the same apk and I had to generate two different ones, what would be the procedure to do it in a way that makes it as easy as possible to switch between the two versions (and thus be able to automate it when building both apks)?

I tried to generate an apk that would work for both Quest 2 and Android but got the following error on the adb console

2023-01-03 12:32:59.297 15363-15435/? E/Unity: Exiting application:
    
    This .apk was built with the Oculus XR Plugin loader enabled, but is attempting to run on a non-Oculus device.
    To build for general Android devices, please disable the Oculus XR Plugin before building the Android player.
    
    
    Unity.XR.Oculus.OculusLoader:RuntimeLoadOVRPlugin()

What I expect to happen is that it can be executed on both platforms since my intention is that Unity itself separates (with my own script) both platforms in different scenes.

Yamika
  • 13
  • 3
  • @shingo I have tried all the possible solutions from that post but the only one that has worked for me has been to extend the `IPreprocessBuildWithReport` class because the oculus plugin closes the application quite early and it is difficult to check if the XR configuration manager is initialized as it takes too long. But this solution only helps me to generate two different apks, isn't there a way to do it all in a single apk? – Yamika Jan 03 '23 at 13:20
  • Mandark's answer has shown where the plugin quits the player, so have you tried to disable the plugin and manually run the OculusLoader? – shingo Jan 03 '23 at 14:03
  • @shingo I've tried to keep it initially disabled and then enable it on runtime but the app in Quest starts in windowed mode as if it were a normal Android apk, whereas if I keep initialization enabled in XR player settings then it's not possible to run it on Android, I tried make sure and even though the functions are called correctly, the initialization ones and the OVR initialization function is called in the editor, it seems as if in the build it doesn't work as expected. – Yamika Jan 03 '23 at 20:55

0 Answers0