On 150 ratings, 5 of them gave me one star, telling me “the game doesn’t save”, but it does save on the vast majority of others. This happens on various phones (even on Galaxy S7), from OS4.4 to 6.0, but other players with the same phones/ same OS don’t have the problem.
I can’t debug this properly because :
I can’t reproduce the problem
and these players with the problem don"t answer my questions :-/
Some infos :
I’m doing PlayerPrefs.Save(); just after all my PlayerPrefs.SetInt()
I’m not doing these on a loop, not even doing these before an application.quit() , not even before an application.loadscene()
And my app is 40Mo, if that does matter.
I can’t really believe it’s a memory failure because I’m only saving a few integers…
I’m thinking maybe these people have got an app that is deleting other app’s caches ? Does that exist ?
I really don’t know what to do here … Do you guys have any idea ?
P.S. question already posted by me there, but I’ve been told to seek help here instead.
PS.2 : Question also asked by this guy here. But no one found a solution.
I don’t even use the playerprefs.save() and it correctly saves, maybe they swapped the game from internal to SD card? Do you have the external storage permission ticked in the player settings?
I’ve moved the app on the SD card and I tried to save again -*** I haven’t put in the manifest or in Unity’s app’s settings any permission to write on the SD card. (it’s still the default “Write permission” - “Internal”) ***- : And it’s still saving properly !
I’ve explored my files on the phone with a file manager and I saw that the cache is still located on the phone’s storage, when the app itself is located in the SD card.
So I didn’t reproduce the problem on my phone by doing this.
Several questions appear :
is that normal that playerpref is still saving on the phone’s storage when the app has been moved on the sd card ?
And could it be that it’s not working the same way on all android phones ? (some phones would have playerprefs trying to save on the SD card, which would fail because it needs a permission ?)
If we assume it’s the problem … I don’t want all the players to to get the scary message warning you get by choosing “write permission - External SD Card” … It should happen only for those with this issue.
So I thought of trying the setting : “Install Location” - “Force internal” - but I 've found out that you can still, manually move the app on the SD card …
I’ve found that thread with people having these kind of difficulties with Sd card / internal storage issues (and no solution yet) :
Hi. PlayerPrefs works fine for me. From 3300 ratings/comments from my players - no one was telling me about “the game doesn’t save”. May be you are saving to much data? (there is a limit for amount of data you can save using PlayerPrefs).