The save system stopped working after updating to android 11.
Hi, have you figured it out?
I ran into similar frustration, but Iāve come up with a workaround for my project. To be clear, the issue I was seeing was that APKās built on someone elseās machine would run just fine on my Android 11, but not when built from my machine. (My project needs to save some initial data during startup, and doesnāt load properly otherwise.)
At first I thought this was an issue with the way I had installed Android Studio, even though I followed UE4ās (outdated) documentation. It turns out, it doesnāt matter if I use Android Studio 3.5.3 (the documentationās recommendation) or 4.1.3 (the current latest), so that was a rather misleading rabbit hole.
The actual issue (in my case) is that SDK 30 (for Android 11) enforces an application sandbox mode (see the warning on https://developer.android.com/training/data-storage/use-cases#opt-out-in-production-app), and UE4 hasnāt been updated to play nicely with this. So you need to specifically target SDK 29 or earlier. For whatever reason I wasnāt able to do this from UE4 settingsāit either ignored my changes, or else I was doing it wrong, because it always wound up targeting SDK 30 (thereby causing this permission issue).
To see if you have the same issue, run your project on an Android 11 device and check the ālogcatā (either from adb or via Android Studio), and look for the following error: java.lang.IllegalArgumentException: Primary directory UE4Game not allowed for content
.
My current workaround is to Package the project for Android in the regular way (from UE4, File ā Package Project ā Android), but then to load the resulting Android project (Intermediate ā Android ā gradle) via Android Studio and manually change the ātargetSdkVersionā to 29. This can be done in Android Studio by opening the ābuild.gradleā file from the Project explorer (and then look under āGradle Scriptsā). Be sure to open ābuild.gradle (Module: app.app)ā, not the project ābuild.gradle (Project: app)ā file. It probably wouldnāt hurt to run Build ā Clean Project at this point, though it might not be necessary. After that my project runs fine! Granted, itās not a difficult workaround, but it would be nice to have an actual solution via UE4.
Anyway, I hope this helps resolve your issue! It sounds like it might be the same as mine. It was certainly hard enough to track down that I thought it worth posting here.
(One final note: I seem to have better success with Android Studio 4.1, rather than the outdate version that UE4 documentation insists on. I think maybe my local Gradle version wasnāt wanting to play nicely with the outdated version of Android Studio 3.5.3, and I didnāt want to bother trying to mess with it when I already had a workaround. In other words, I can confirm that I can build the UE4 project and debug C++ code via Android Studio 4.1, so Iām not sure why I would need to use the older version.)
Many thanks
I found this while trouble shooting the other day, and it was the realisation that I needed to be on 29 that solved my issues. I had to search to find this again just to say - thank you, AxiomRL.
As an aside, found a weird issue where Unreal would not build to API 29 for me while 30 was installed. If anyone else has this issue - I uninstalled android 11 from Android Studio, fixed that issue.
But will google allow to upload if i uninstall API 30 and set target API to 29 ?
I mean i am in development still and i am having issue creating save files. And may be by the time i finished my project google may set minimum require API to 30, wouldnāt it ?
EDIT : I searched on internet and i found this link about android 11 Android 11ģ ģ ģ„ģ ģ
ė°ģ“ķø | Android ź°ė°ģ | Android Developers , Seems from android 11 they are terminating access to external dir. and theyāve added called āscoped storageā functionality.
I am no export in any programing, i am just blue print user, so you guys might understand if this is root problem of files not saving on android.
Anybody come up with proper solution to android 11 game save issue???
Brother sdk 30 is compulsory by google now⦠How you managed to save game in android 11??
Iam really stuck here
Brother have you sorted the problem related to android 11 saving? Iam badly stuck here