Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Meta/Oculus OVR Build APK menu generating multiple versions.

Discussion in 'VR' started by Ebonicus, Apr 14, 2023.

  1. Ebonicus

    Ebonicus

    Joined:
    Oct 31, 2016
    Posts:
    158
    I believe there may be something wrong with OVR Build APK and the gradle cache usage for sequential building of the apk. Here is the scenario, and it it is very odd.

    In unity I use OVR Build APK with headset connected.
    Console reports that apk was transferred to device, and I can play new version on headset.
    When I use Oculus developer to look at the file on the device, I can confirm it has the correct date, today:

    Fig 1: Installation at first yellow highlight.
    upload_2023-4-13_16-19-43.png

    I can play the new version with no issue, and the OVR Build APK is still running, and for the final APK output, not sure why, but runs gradle again, to make the local APK in the output folder.

    This shot shows the two transfers in yellow in console. They are both different versions of the apk.

    upload_2023-4-13_16-39-3.png

    In the shot above, the first yellow highlight pushes correct new APK to Oculus.

    On the second yellow highlight, it transfers an OLD version of APK to headet ( which restarts the app in the headset while I am playing the new version.) When the app restarts, it is the old version from yesterday.

    When I use Oculus developer to look at the file on the device, it now has an older date:

    Fig 2: Installation at 2nd yellow highlight.
    upload_2023-4-13_16-15-23.png

    So in one push of OVR Build APK, it pushes twice to my headset, and the 2nd push is always from yesterday. I don't even know why OVR APK build has to make 2 apks to build and run, that is already annoying as it is, but now one version is different from the other, this is driving me nuts.

    I also cannot locate the ..\Temp\OVRGradleExport\build\outputs\apk\release\launcher-release.apk to wipe that folder or file. The APK from yesterday does not exist anywhere on my PC, but may be some form of an old gradle cached version. I have no idea what APK OVR Build APK is pushing to my device during the second push to device.

    If I use Oculus developer console to load the latest build again to device from the build output directory, the headset runs the latest version, and Oculus developer shows that the correct version is on the device which matches the APK on my my PC, inside the build output folder correctly.

    Currently the only way I have around this is to let OVR Build APK push the first apk to the headset, then cancel so it doesn't push a second old version to headset.

    I can also disable the build to device option, let it generate the APK, then drag/drop manually with Oculus developer. But this flow crashes more often during build. It would be nice to build once and have unity just push proper apk to device using OVR build apk, because this get as many build failures.

    Am I the only one to have this issue? I can repeat it in empty projects.
    This is infuriating because if I walk away during build, it keeps pushing 2nd time with an old APK and overwriting the one I am trying to test ( first apk pushed to device).

    I am on Unity 2020.3.46f1 and Meta XR Utilities 50.0, and running the utils from Meta's scoped registry,
    because if I install Oculus Integration package, their scripts have hundreds of build errors, so I am running barebones XR utilities 50.0 dated Mar 16, 2023, and built all my own prefabs/UI tools using the OVR utility scripts.
     

    Attached Files: