0

In my Unity project for android, I save files in .json and textures on Application.persistentDataPath. In the beginning, every time I downloaded and reinstalled a new version of the build of my project on Android for internal tests in Google Play Console, below Android\data\ProjectFolder\files on phone it recreated (before the first start) an old .json (with old data from a previous update) and old textures. I partially solved this problem by adding

android:allowBackup="false"

on the AndroidManifest, but now another problem (also present before) persists: When I try to reload the data contained in the .json (I noticed, this just happens only the second time I load this .json datas, after the awake > on which the first loading from that .json takes place correctly) it reloads the old data (the ones it loaded also on the installation before I added to application android:allowBackup="false" in the androidManifest)

In Unity I save these files on Application.persistentDataPath, but I read on the documentation that "When you publish on iOS and Android, persistentDataPath points to a public directory on the device. Files in this location are not erased by app updates". So, could be this the problem (hence that the program continues to read these old undestroyed files by mistake from a previous session, in which I hadn't yet disabled the backup? if so, should I change path (for example, save them to Application.datapath) to solve that issue?

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 07 '23 at 05:55
  • I've rephrased the question, and added some details that I believe are related to the problem – Mario Rossi Aug 07 '23 at 23:01

0 Answers0