[Bug] PlayerPrefs are deleted when I restart my app

Hi,
My project and PlayerPrefs was running fine with Unity 5.4.1f1, but when I upgraded my project to Unity 5.4.1p2 (without changing anything in the code) the PlayerPrefs started being deleted every time I restart my app (when my app is running the PlayerPrefs is saving values ok, but when I close my app and reopen it all PlayerPrefs are lost).

This bug is happening only with Windows 10/8.1 Universal, PlayerPrefs are working OK with Android and no date are lost when I restart my app.

Please to take a look at this issue and find what you introduced in Unity 5.4.1p2 that breaking the PlayerPrefs for UWP/WSA.

Bug case: 835218

Thanks

1 Like

I have had similar but different problems with PlayerPrefs too on Windows 10 with 5.3 versions.

In-App Purchases unlocks the full version:

PlayerPrefs.SetInt(“package_1_bought”,1);
PlayerPrefs.Save();

Working fine.

But I have received at least over 20 emails so far that after few weeks,
full version is no longer unlocked. For some reason PlayerPrefs had lost the data, no idea why. Does not happen on other platforms. Had to made different way to save unlocking.

I hope they check this ASAP, holding my update release until this and the random freeze error is fixed.

We checked it first thing on Monday since the report sounds really scary. However, we could not reproduce it. It works fine on our end, and @Wadjey didn’t send us a repro project :.

Hi,
Any hope to get this bug fixed in this week patch release? If no, there is a temporary workaround for this issue? (I tried deleting Library folder but it didn’t solved the issue for me)

We have finally received repro project and the fix is in place. We’ll try to get it out with patch release ASAP. There’s no trivial workaround unfortunately as preferences file gets overwritten on startup every time. Nontrivial workaround is to save preferences in a custom file.

1 Like

Anyone tested are PlayerPrefs working with 5.4.2 ? :slight_smile:

No it still not fixed in v5.4.2f1

1 Like

same problem here… everything works in 5.3p6 but playerprefs are cleared in unity 5.4 versions

@Ignas83 do you have an ETA for the patch?

Should be fixed in 5.4.2p1. I’ve asked QA to double check on this.

this is 3/11/2016 and i’m still facing this bug in 5.4.2 on Windows App.
Any news on this?

Did you not read above? try and download latest patch release and test