x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Saving and loading problem on android only

I'm using this save system in my game:

alt text

I have this system in 3 blueprints in my game scene which are going to be saving/loading data somewhere during run time. They're always on the "Event begin play" and "Event Construct" nodes.

When I need to save a value I use:

alt text

When I need to load a value I use:

alt text

and It works fine... In editor and development builds.

Now in shipping builds it's a whole different story.

First of all I have it it so the game is in one apk file and I have the "Use ExternalFilesDir for UE4Game Files" Option unchecked since I found it to be very prone to exploitation from the player, I also wanted the saves to be persistent through uninstalls. I added the following permissions to the "Extra Permissions" Section of the Advanced APK Packaging menu: android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_EXTERNAL_STORAGE android.permission.WRITE_INTERNAL_STORAGE android.permission.READ_INTERNAL_STORAGE

I also added the to the android manifest manually just in case.

If I build my APK as a development build, everything works fine, the APK asks for external storage permission on installation and the saving and loading work fine. When I try building my APK for distribution though the APK does not as for any permission and the saving and loading don't work, I then go inside the app permissions in my phone's settings menu and manually grant the game storage permission which makes the menu scene able to "sometimes" save and load a value or two, however the game scene is still unable to save/load anything.

I've been pulling my hair out on this issue for a while, testing it on multiple devices and trying a bunch of different solutions that proved fruitless such as trying the "Use ExternalFilesDir for UE4Game Files" option.

at the moment I'm at my wit's end and don't have a clue where to go from here, without this feature I really don't have a game, so any help you can provide my with is very very much appreciated.

Thanks in advance.

Product Version: UE 4.20
Tags:
more ▼

asked Sep 13 '18 at 07:55 AM in Blueprint Scripting

avatar image

MicroGT
31 3 6 58

avatar image SHOBBIT Nov 11 '18 at 05:19 AM

I will +1 this too. The exact same issue is occuring with me too. The version is 4.19. When packing for distribution after putting my keystore file, the save system simply stops. When not packaging for distribution, it works fine.

In my case only when "Use ExternalFilesDir" is checked the save system works.

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

Don't know if it's the full picture, but since the latest android patch, my device is not granting "storage" permissions to the game when installed from the PC. But you can go to "App Info" on the device and grant it manually, now my game is saving again. I wonder if it'll have this issue when installed from the Google Play. hope not.

I though it was 4.21, but it seems is not an issue on UE4 side. but on how Android treats Apps installed from wherever.

more ▼

answered Nov 11 '18 at 04:49 AM

avatar image

Evigmae
1.6k 7 3 8

(comments are locked)
10|2000 characters needed characters left

Hi did you had a chance to test on the "Google Play" side if it is working without extra permissions?

as per 4.21, the save slot file is in the PrivateStorage of the app so it should not required extra permissions. I opened a case on this. I will update here if I have a feedback.

As of today, I had to put the ExternalFileDir option to true in order to not block my development process, but I won't publish my game with this option set to true

Thanks!

more ▼

answered Jan 18 '19 at 11:47 PM

avatar image

Elvince
464 42 67 152

(comments are locked)
10|2000 characters needed characters left

This issue is happening because the game has no Certificate. Unlike Development Build Version of the game, when installing the Shipping Build Android thinks it's a harmful app thus denies any permission by default (Without asking you). That's why you have to manually set permission in your Android Device.

If you create and install a certificate for your game or upload and download the game from Google Play Store the game will work just fine as expected.

Hope this helps!!! :-D

more ▼

answered Mar 08 '19 at 10:35 AM

avatar image

LightPS
1 1 1

avatar image Elvince Mar 08 '19 at 10:58 AM

This is not true. I had a long talk with support of EPIC and they do confirm that we must check ExternalFileDir to have the file save in the ApplicationStorage. The name of the option is confusing, but as per our conversation that was validated by Epix Tech staff, this option allow in 4.21 to save the file at the right place. All those confusing stuff is linked to changed in API of google.

thanks

avatar image LightPS Mar 08 '19 at 11:03 AM

Thanks for this "Precious Info". This was a huge issue for publishing a game, I'm glad it's Solved.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question