Random PlayerPrefs strings disappear after updating the game

Hello,

I use PlayerPrefs to save user data. There is inventory system in the game. All items are saved with PlayerPrefs using strings. And I am straggling with a weird bug that delete some of saved strings in some users after updating the game.

One month ago I updated the game on Google Play Store and got a lot of reports from users saying that they lost some of thier items or all the items after last update. It was a big surprise because neither I nor my friend, that also worked on the game, didn’t lose any old item after testing the update. All our familiar also didn’t lose anything.

We played on older version and update it to the latest version, trying to reproduce the bug, but still nothing lost. I also downloaded the old Google Play version of the game and updated the game from Google Play - also nothing lost. Tested on several devices.

We asked some players if they lost their items, more than a half lost nothing. So I thought that it was not connected with updating and there was some bug that delete items during playing. But I didn’t manage to find anything in a week and there were no new reports about items disappearance since 1-2 days after update.

We haven’t had any reports about items disappearance till now, when we released our new update. After what we got ton of reports about losing items. We made a poll and found out that 40% of players lost some of their items. All lost items were totaly different. The amount of lost items was random, someone lost 1 item, someone 3 and so on. All players that lost items have different devices, different android version and there doesn’t seem to be a pattern of that bug. All those players lost their items after opening updated game .

I released some updates with minor bug fixed to ensure that loses happen exactly because of updating… And yes, some players also lost some random items, new reports appeared.

I have no idea what can cause that bug. It seems to be that some random PlayerPrefs strings just dissapear in some player after updating the game. I don’t know what to do.

I also thought that the problem can be connected with Unity. I updated it one month ago from 2020.1(I guess) to 2020.1.2f1, exectly when the bug appeared.
One day ago I updated Unity to the last version (2020.1.6f1) and released a new update and also got reports.

Some people will uninstall the game and then reinstall it (because reasons). So when game is installed again the Android auto backup might restore a game state backup that is not from latest step that player took (because Auto backup wasn’t triggered).

Thanks for reply,
I am trying to disable backup in Android Manifest right now, but cannot build the game. It is saying:

6372375--709392--error.png

I added "tools:replace=“android:allowBackup” but it doesn’t work
6372375--709398--manifest.png
It says that allowBackup=true from GooglePlay Manifest collides with allowBackup=false from GooglePlayGames Manifest, which was set by me. I didn’t find any GooglePlay Manifest in the project in order to edit the value there. It is auto generated during the build I suppose.

How can I handle this?

There is tools:replace if you want to override values from other manifest files

I used it, but it didn’t help. Look at the screenshots above

You were right. Old data suddenly appear after updating the game in some users. But It seems that Google Play Services don’t allow me to off backup. I managed to build the game, uncluding my own Manifest by ticking this:

6376287--709941--upload_2020-10-2_20-34-10.png

But it didn’t work. I think it didn’t add my Manifest at all. The game still backups…

I am using Google Play services to save user progress on Google server, but It just saves the data. Data can be loaded only when the game is first installed and it also ask the user if he/she wants to restore the data from Google server. So my code cannot suddenly load and set some data without permission from user. So it is not connected with my saving code.


6376287--709941--upload_2020-10-2_20-34-10.png