Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

PlayerPrefs persist in Android device after App uninstall

Discussion in 'Android' started by abermann_O, Nov 28, 2018.

  1. abermann_O

    abermann_O

    Joined:
    Aug 16, 2018
    Posts:
    42
    Hi!

    I want my PlayerPrefs to be deleted from myAndroid device if I uninstall the app (let´s say its for debug purposes).

    I´m pretty sure I´ve got a clean start before on new builds to the device, but now, everytime I uninstall / build my app to the device, it starts in the same slot it was before (same scores, states, etc.), which makes debugging very difficult.

    I know I can delete all playerprefs when the app starts, but I´d rather understand what´s going on here...

    Thanks everybody!
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    Hmm... as I understood it, PlayerPrefs should get erased on uninstall - but then again I just assumed that was the way it was and went on without really testing that, so who knows.

    Are you on 2018.x? If this is an intended new way for PlayerPrefs to work, I didn't know about it until just now - so I hope somebody has a solid answer, but have you tested this for sure and it always remains through an uninstall? What about if you kill the app in recent apps before uninstall then reinstalling? I doubt that would have anything to do with it, but just as a debugging step?
     
  3. abermann_O

    abermann_O

    Joined:
    Aug 16, 2018
    Posts:
    42
    Thanks for taking the time to answer, MD_Reptile.

    Yes, I am in 2018.2.17f1, and I went through the uninstall-rebuild to device process several times, always with the same result: the PlayerPrefs remains on the phone. And I always kill the recent apps list before doing anything with the game, even when they say that actually impact performance in a bad way.

    Too bad I can´t root the mobile (it´s a corporate device, so I don´t have that kind of rights).

    Best regards, and thanks again!
     
  4. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    824
  5. abermann_O

    abermann_O

    Joined:
    Aug 16, 2018
    Posts:
    42
    Tha
    Thanks for your kind answer, and sorry for my delayed answer, I´ve just see it today. I´ve already see those links, but I´m 100% sure the problem is the Playerprefs remain in the phone after uninstalling, because I made a test witl Playerprefs.deleteAll, and then everything works fine. I´ll keep looking for a solution, it´s a very important issue. Best regards
     
  6. Wecica

    Wecica

    Joined:
    Jul 20, 2016
    Posts:
    27
    Hi, abermann_O, I encountered the same problem now, did you find a solution for this?
     
  7. cyborgjinx

    cyborgjinx

    Joined:
    Dec 10, 2014
    Posts:
    28
    Did anyone find a solution? I'm suing allowBackup="false" but it still doesn't work.
     
    DeplikeIT likes this.