flutter_secure_storage icon indicating copy to clipboard operation
flutter_secure_storage copied to clipboard

[BUG] Data not stored properly in flutter_secure_storage: ^10.0.0-beta.4 on some devices

Open GowthamanRavichandran3 opened this issue 6 months ago • 15 comments

After upgrading to flutter_secure_storage: ^10.0.0-beta.4, we observed that the data written using write() is not being stored or retrieved properly on some devices. This leads to critical app functionality failures and makes the app unusable in production.

Steps to Reproduce:

  • Upgrade to flutter_secure_storage: ^10.0.0-beta.4
  • Write any value using storage.write(key: ..., value: ...)
  • Try to read the same value using storage.read(key: ...)
  • On some devices, it returns null instead of the written value

Expected Behavior: The written value should persist securely and be retrievable on all devices, as it does in version ^9.2.2.

Actual Behavior: Values are not being stored or retrieved correctly on some devices.

Affected Devices:

  • Moto G32 (Android)
  • OnePlus (Android)
  • Some Android emulators

GowthamanRavichandran3 avatar Jul 07 '25 06:07 GowthamanRavichandran3

Same behaviour on Xiaomi Redmi Note 11 Pro Thank you for fixing

LifeNow avatar Jul 07 '25 15:07 LifeNow

Same behaviour for Xiaomi 11 Lite 5G NE It's a real critical bugs as it's the primary role of the package Thank you for fixing

clemortel avatar Jul 09 '25 06:07 clemortel

Same behaviour on Sony XQ-EC72 Thank you for fixing

morrischen avatar Jul 11 '25 03:07 morrischen

Same behaviour on Pixel 7. Thank you for fixing

marcogramy avatar Jul 11 '25 07:07 marcogramy

Yeah i recently notice this as well. Was there any undocumented changes we aren't aware of? I can reproduced it on

  • Samsung Galaxy Z Fold6
  • Samsung Galaxy Z Flip6

I wasn't aware of this issue at all until last week when users with said device reported that their app wasn't functioning properly, took me a while to debug and found out since we have re-fetch value via API as backup procedure so it wasn't clearly seen until an user manage to produced it.

famasf1 avatar Jul 16 '25 07:07 famasf1

iPhone 13 as well

srdjan86 avatar Jul 16 '25 14:07 srdjan86

@famasf1 did you manage to handle this issue? I also receive reports from users, but unfortunately I was not able to reproduce the behavior yet.

mixable avatar Jul 21 '25 08:07 mixable

@juliansteenbakker is the package still maintained ?

clemortel avatar Jul 21 '25 09:07 clemortel

@famasf1 did you manage to handle this issue? I also receive reports from users, but unfortunately I was not able to reproduce the behavior yet.

Not really. For now, I put data saving logic into related features, making it essentially save the same data twice. No feedback yet so I assumed it worked well enough for the time being.

famasf1 avatar Jul 21 '25 09:07 famasf1

Similarly on our application users started reporting problems after upgrading to V10 on some Android devices, we couldn't reproduce the issue on our models. Downgrading to v9 fixed the issue for them.

joosakle avatar Aug 05 '25 12:08 joosakle

Same behaviour on

  • Redmi Note 13
  • Xiaomi 14T Pro
  • Mi 9T Pro
  • Galaxy A03
  • Galaxy S21 5G
  • Pixel 8
  • Pixel 7
  • Infinix HOT 40i
  • Infinix HOT 30i

DmitrDomrachev avatar Aug 30 '25 10:08 DmitrDomrachev

We are experiencing the same issue on Samsung A-series

iamEtornam avatar Sep 30 '25 12:09 iamEtornam

I don't have a device to repro on, but I've had users with this issue.

Could someone with a device help test what exactly is happening? 🙏🏾 Specifically

  • Can you reliably write a key and then subsequently not be able to read it?
  • If so, can you try writing the key, and then doing a readAll? Curious if the key is being written incorrectly or not at all

I'd be keen to dive in and figure out the exact issue here, as it is affecting my in-app oauth flow 😢 https://github.com/ThexXTURBOXx/oauth2_client/issues/11

ViscousPot avatar Oct 21 '25 20:10 ViscousPot

I ran into the same problem on Samsung.
I will only add that the first installation works fine. Backup is enabled on the phone. After reinstalling the application, secure storage stops sending data, while there are no errors when calling write.

Version: 10.0.0-beta.4,

Pluxury avatar Dec 10 '25 14:12 Pluxury

We have version 10.0.0-beta.5 out right now, which has lots of changes on the android side. Could you try and test it with that version?

juliansteenbakker avatar Dec 10 '25 14:12 juliansteenbakker

We have version 10.0.0-beta.5 out right now, which has lots of changes on the android side. Could you try and test it with that version? @juliansteenbakker

Checked several times for 10.0.0-beta.5 and it seems the error has really gone away. I note that I have a Samsung A50 and the backup of application data is enabled on the device.

Pluxury avatar Dec 11 '25 07:12 Pluxury