flutter_secure_storage icon indicating copy to clipboard operation
flutter_secure_storage copied to clipboard

Data is lost after app reinstall on Android (even with allowBackup=true)

Open EricFrancischett opened this issue 9 months ago • 3 comments

I am experiencing an issue where the stored data in flutter_secure_storage is lost after reinstalling the app on Android. I have already ensured that android:allowBackup="true" is set in my AndroidManifest.xml, but the issue persists.

I found a similar issue reported here: #817, but I didn't see a clear resolution.

Steps to reproduce: Store data using flutter_secure_storage on an Android device. Uninstall the app. Reinstall the app. Try to retrieve the stored data. Expected behavior: The stored data should persist after reinstalling the app, as android:allowBackup="true" should allow it to be restored.

Actual behavior: The data is completely lost after reinstalling the app.

Additional notes: I have already checked my AndroidManifest.xml, and android:allowBackup="true" is correctly set. This behavior is unexpected, as I assumed the data should persist across reinstalls. Could you confirm if this is the expected behavior, or if there is a workaround to ensure data persistence after reinstalling the app?

Thanks in advance!

EricFrancischett avatar Feb 12 '25 15:02 EricFrancischett

#817 as @juliansteenbakker said, it doesn't enough to config only AndroidManifest.xml to save ur Shared preferences. ref : https://developer.android.com/identity/data/autobackup i think this will help ur solution

nitipat009 avatar Feb 25 '25 09:02 nitipat009

Possible duplicate of https://github.com/juliansteenbakker/flutter_secure_storage/issues/876?

vanyasem avatar Apr 13 '25 09:04 vanyasem

⚠️ This issue has been marked as stale because it has been open for 60 days with no activity.

If this issue is still relevant, please comment to keep it active. Otherwise, it will be closed in 60 days.

github-actions[bot] avatar Jun 13 '25 03:06 github-actions[bot]