Android UE4Game Folder Not Created at Game Startup - Breaks SaveGame

When I install my Unreal game as an Android APK to an Android device (Oculus Quest 2), the first time I run the app, the UE4Game folder is not created at startup as it should be, even if file write permission is granted by the user when prompted in the game. This breaks any functionality that requires the UE4Game folder such as the SaveGame system. Subsequent executions of the app work fine, but the first time the app is executed, all UE4Game folder related systems are broken for the duration of execution.

Specifically, this issue occurs the first time the app is launched after installation and when Android file permissions have not already been granted to the APK before opening. For example, this error occurs in scenarios such as downloading an APK from the Oculus Quest store, or simply installing the APK from the command line. This error does not occur in scenarios that grant APK permissions up front such as the UE4 Editor Launch menu.

Here is a step by step sequence of what happens:

  1. User installs APK on Android device without granting permissions at install time
  2. User opens the app on the Android device
  3. Once opened, the user is prompted to provide file write permissions to allow the creation of UE4Game folder
  4. User grants write permission
  5. Creation of UE4Game folder by the app silently fails behind the scenes
  6. User continues using the app and attempts to Save the game
  7. The user is unable to save the game, but no crash occurs
  8. User closes and restarts the app
  9. UE4Game folder is created by the app at startup
  10. User can now Save the game

Is anyone aware of this bug or know how to fix it?

I am using the Oculus 4.26.0 source of Unreal Engine.

This happens due to a lack of write permissions in Dev-builds, you can throw SplashActivity which will not allow the application to start without permissions using bShowLaunchImage = True in DefaultEngine.ini. But Im not sure if u need this in Shipping builds. You can edit UEDeployAndroid.cs if u need this folder only for Dev-builds