Question by
idan48 · Jan 31, 2021 at 06:19 PM ·
androidandroid buildplayerprefsmanifestplayerpref
[SOLVED] PlayerPrefs work on my PC but not on my Android
Hi! :) I have a playerprefs variable that saves the amount of levels unlocked.My code works perfectly on pc, but when I put the game on my xiaomi android it won't work.
Note: The app is not requesting any permissions to storage or files, even after reinstalling, Note: The app is not in Google Play, I just built it as an APK and put it in my phone via USB cable.
I am about to release my game in a couple of days, so any help will be awesome!
(could that be related to the android manifest?)
Comment
Best Answer
Answer by idan48 · Feb 04, 2021 at 02:52 PM
solved - add these lines in start:
private void Start()
{
if (!PlayerPrefs.HasKey("_unlockedLevels"))
{
PlayerPrefs.SetInt("_unlockedLevels", 1);
}
}