Android versions of 6.0 and above (API 23) will back up your app’s data files and then automatically restore them when the app is reinstalled. This can cause unexpected behavior if you are using invalidateExistingUser: true, if the backup is outdated, or if you are testing.
We recommend you disable automated backups for your app by using:
in your AndroidManifest.xml file.
If your application must allow backups for other purposes, be sure to exclude the appropriate SDK files from full backup. You do this by adding an .xml file with backup rules to your app, and then specifying that .xml file in the AndroidManifest.xml file:
The following files must be excluded by adding backup rules for them:
If you use locations, you must also exclude:
If you use inbox messages, you must also exclude:
Finally, if you use in-app messages, you must also exclude:
This will ensure that an outdated backup does not cause problems when your app is reinstalled.
More information about including and excluding files from backup is documented at Including and excluding files from backup.