Page 1 of 1

ES3.DeleteFile() not deleting save data on Android

Posted: Mon Mar 08, 2021 3:28 am
by cyangamer
I'm using Unity 2018.4

I want users to be able to erase their save file in the menu so that they can play again once they've beaten it. When I playtest this in the editor, the file is deleted as expected. However, when I build the game and run it on my device (Pixel 3), the save file does not get deleted.

Here's the line of code I'm using:

Code: Select all

ES3.DeleteFile(ES3Settings.defaultSettings.path);
My game uses the same persistentDataPath everywhere in the code and there's always just one file to delete. This could be a bug, but is there something else I should be trying?

Thanks

EDIT: The Android OS is restoring the file as soon as it gets deleted. I will look through Google's docs to find a solution

Re: ES3.DeleteFile() not deleting save data on Android

Posted: Mon Mar 08, 2021 8:25 am
by Joel
cyangamer wrote: Mon Mar 08, 2021 3:28 amEDIT: The Android OS is restoring the file as soon as it gets deleted. I will look through Google's docs to find a solution
Hi there,

It sounds like Android might be constantly downloading it from the cloud rather than syncing the change. Unfortunately we don't have control over this at our end as this is defined at the OS level. However, I recommend asking on Android forums to see if anyone else has encountered this issue with Android storage.

Also just a small note: by default the the ES3.DeleteFile method uses the default filename, so you can call ES3.DeleteFile() instead of ES3.DeleteFile(ES3Settings.defaultSettings.path).

All the best,
Joel

Re: ES3.DeleteFile() not deleting save data on Android

Posted: Wed Apr 07, 2021 2:55 am
by cyangamer
Thanks for the tip Joel! You were exactly right.