flutter_secure_storage icon indicating copy to clipboard operation
flutter_secure_storage copied to clipboard

Flutter Secure Storage Issues: Unable to read or write keys and values

Open KeroJohn97 opened this issue 2 years ago • 5 comments

This may be a stupid question, but I’m not familiar with this so I asked it in Stack Overflow. https://stackoverflow.com/questions/70014273/flutter-secure-storage-issues-unable-to-read-or-write-keys-and-values Does anyone know how to solve this problem?

KeroJohn97 avatar Nov 18 '21 03:11 KeroJohn97

Did the answer on stackoverflow fix your problem?

juliansteenbakker avatar Nov 19 '21 07:11 juliansteenbakker

No, that answer belongs to the class structure, for now I used back version 4.2.1, that package is working on my Android device.

KeroJohn97 avatar Nov 19 '21 08:11 KeroJohn97

Do you have any logfiles of the error, or an explanation on why it's unable to read or write keys and values?

juliansteenbakker avatar Nov 19 '21 09:11 juliansteenbakker

I am facing the same problem.

jiangxiaoqiang avatar Dec 01 '21 13:12 jiangxiaoqiang

I think the reason for reading / writing problem can be inconsistency with using aOptions or iOptions. For ex. you are using aOptions with readAll(), deleateAll() and write() methods and you don't use it with read(), delete(). So, when using encryptedSharedPreferences: true, in aOptions when you write data to secure storage, you specify that this data must be written to EncryptedSharedPreferences. However when you read the data without providing aOptions again, you try to read from default secure storage which is not the EncryptedSharedPreferences where you have stored the data.

paj-co avatar Dec 02 '21 17:12 paj-co