ES3.DeleteFile() not deleting save data on Android

Discussion and help for Easy Save 3
Post Reply
cyangamer
Posts: 4
Joined: Mon Mar 08, 2021 3:22 am

ES3.DeleteFile() not deleting save data on Android

Post 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
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

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

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
cyangamer
Posts: 4
Joined: Mon Mar 08, 2021 3:22 am

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

Post by cyangamer »

Thanks for the tip Joel! You were exactly right.
Post Reply