0

How is it possible that the SharedPreferences data is lost due to an app update on Flutter. After an update, some users reported that the data was no longer available.

After a lot of research, the only possible cause I could find was a change in the AndroidManifest (adding permission). -> [Link]

Is this possible and more importantly how can I avoid the error in the future?

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
FreeDevGer
  • 27
  • 4
  • That looks to be a very Android native specific issues. If you need to store something you really care about in the device, try to use a persistent SQL/NoSQL like file. With the right settings you can hold the information while doing updates and even while deleting the app – Mariano Zorrilla Oct 01 '22 at 20:39
  • @MarianoZorrilla Thanks, I'm already doing that. However, I would still like to be able to use SharedPreferences for "small settings". And somehow I can't imagine that there isn't a solution for this, because otherwise SharedPreferences would be almost completely useless if the data is constantly being lost. – FreeDevGer Oct 01 '22 at 20:44
  • Did you find a solution for this? im facing the same issue in flutter, but only on iOS devices – Ali Nov 22 '22 at 19:14

0 Answers0