1

I use SQLite database in my app. Everything worked fine up until recently. Now whenever I do new build from Studio on my Android device everything gets reset into a state that it was like several days ago. The same items are present and all changes that I did to them are lost.

Is there some way to fix this or clear this cache? Even if I remove app from device, Studio on next build inserts the save data. Change the option to preserve data does nothing too.

Tomáš Chylý
  • 342
  • 1
  • 8
  • 21
  • By `I do new build from Studio on my Android device`, what do you mean, I can't understand the operation. – Robbit Mar 13 '18 at 08:06
  • I connect my Android phone to PC with usb and hit play button in Visual Studio, which builds the app and deploys it to the device. – Tomáš Chylý Mar 14 '18 at 07:29
  • That mean you uninstall the app and install the new app. So the database file will be remove. – Robbit Mar 14 '18 at 07:32
  • That would be OK, but it is not the case. After uninstall and install, the database is not removed, but studio from somewhere inserts database which it uses when you select the option to preserve data. And it does so even when I disable the option. I want to find the place where this cache is and remove it manualy to reset the project. – Tomáš Chylý Mar 16 '18 at 11:36

1 Answers1

3

I got back to working with Android Studio and there I found out right away what the issue was. Android 6.0 and above has automatic backup feature which is in Xamarin.Forms app on by default. Disabling auto backup makes all my data issues go away.

More information can be found here too: An Android app remembers its data after uninstall and reinstall

Tomáš Chylý
  • 342
  • 1
  • 8
  • 21