-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled Exception: PlatformException(Exception encountered, read, javax.crypto.BadPaddingException: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT #210
Comments
I was able to reproduce this issue with my Galaxy A40 (Android 10):
The error did not occur anymore after I deleted the App-Data (Settings>App>Storage>"Clear App Data"). Seems like this is an restoring issue from some devices. I'll try to overcome this issue by adding the:
flags in the AndroidManifest.xml (see #43 (comment)) |
Issue was resolved the following way: Created a new version for the app:
IMHO this is not an flutter_secure_storage issue. The backup content features should not include sensitive information that should only be stored on the device / used in the same application instance. |
@RANSoftRA one of our users has the same problem with a Huawei mate 20 lite. What error should I catch? And when should I catch the error? |
In my case the error occurred during the login process - it threw a PlattformException. Example - Code In the Widget (so I can display an appropriate Error): class LoginForm extends StatefulWidget {
...
// login - form submit
Future<void> _submit(BuildContext context) async {
final authProvider = Provider.of<AuthProvider>(context, listen: false);
try {
// Performs a FlutterSecureStorage().write('...', '...') at some point
await authProvider.login(_loginData['email'], _loginData['password']);
....
} on PlatformException catch (e) {
_setErrorState(message: 'Please clear App Data');
} catch (e) {
// Handling other errors
....
}
...
}
...
}
|
Do you have an idea why it is required to remove the app data for all users who are experiencing this? For me the issue is happening on a Not sure why this is happening? Is it because when the app is reinstalled the secure store is used. but the keys for opening the secure store are different? |
Yes, I believe this happens, because the used keys change when the user re-installs the app or uses a different device. I have not investigated it further though, but it would certainly make sense. All I know is that after clearing the App data the error does not ocurr anymore. The authors mentioned that the Android backup feature could cause problems (see https://github.com/mogol/flutter_secure_storage#configure-android-version), but not for this issue. Maybe it would be good to mention this issue as well. |
Alright. probably a delete & reinstall will fix the issue as well. |
Hey guys I am not sure this issue should remain closed, it just happened to us in the production environment and it has never happened before. This is a very random issue that might randomly affect real users. |
Hi guys, it's happening here with 3.3.5 too. Maybe this issue shouldn't be closed ¿? |
It's failing on my Pixel 3, but works fine on my Pixel 4a. I'm running flutter_secure_storage version 3.3.5, clean install of app on both phones, production build of app (not debug). I do not have these flags:
Update: It makes no difference whether the above flags are true or false. |
Happening to me too, 4.1 ------Edit if (prefs.getBool('first_run') ?? true) { await storage.deleteAll(); prefs.setBool('first_run', false); Thanks to this guy. |
I am using version 3.3.5 in the production and since few days ago I started getting sentry reports with following error log:
I tried to reproduce the bug, and I manage to do it. Devices that I have tested it Samsung s9 and Samsung s10e => error, Huawei P20 Pro is working and not crashing.
I don't know if this log is helpful, but this is actually a really huge bug. |
Facing same issue with flutter_secure_storage: ^4.2.0 in Android 11. |
I have same issue with flutter_secure_storage: ^4.2.0 in Android 11 on samsung s20. |
Same issue with flutter_secure_storage: ^4.2.0 |
I'm having the same problem. It happens randomly and it never occured before. Please re-open the issue. |
Still an issue. |
Still an issue with the latest version. Issue can be reproduced with re-installing the app but only on specific devices @mogol |
I have opened a new issue to track this #354 |
If the change to the manifest works please add to readme |
Thanks a lot, This is works now. |
Additional to Mentioned issue by @darshankawar After changing
to
the problem still exisits but changes to PlatformException(Exception encountered, readAll, java.lang.SecurityException: Could not decrypt key. decryption failed |
Still an issue. flutter_secure_storage 9.0.0 in Android 9. |
Got the issue randomly on Android 14 devices, LogCat shows following error in production app:
|
Happens in latest version too. Delete cache/all data not works. Only in release mode build, debug works fine. Android 9
|
Hi guys, while using it, please make sure you are passing the AndroidOptions while initializing the instance. Instead of :
try adding as :
Pass AndroidOptions while initializing the instance of FlutterSercureStorage. and mark encryptedSharedPreference to true. This change actually resolved my issue. Hope this helps someone. Thanks. |
That's half true, besides it works on update on store, sometimes on uninstall and install run into problem again. Not fixed at all, tested on Android 14 and 9 |
and this is related to targeting sdk level 34?
i think i got my problem to go away by going back to 33 - but we have to go
to 34 very soon.
…On Tue, Apr 9, 2024 at 7:38 AM Rene Nucci ***@***.***> wrote:
Hi guys, I encountered the same issue recently, I am using
FlutterSecureStorage.
while using it, please make sure you are passing the AndroidOptions while
initializing the instance.
Instead of :
var secureStorage = const FlutterSecureStorage();
try adding as :
AndroidOptions androidOptions = const AndroidOptions(
encryptedSharedPreferences: true, ); var secureStorage =
FlutterSecureStorage( aOptions: androidOptions, );
Pass AndroidOptions while initializing the instance of
FlutterSercureStorage. and mark encryptedSharedPreference to true.
This change actually resolved my issue.
Hope this helps someone.
Thanks.
That's half true, besides it works on update on store, sometimes on
uninstall and install run into problem again.
Not fixed at all, tested on Android 14 and 9
—
Reply to this email directly, view it on GitHub
<#210 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXBGYO2U4LB75Z5N36QT5DY4POKRAVCNFSM4YD6HLL2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBUGUYDQNZSHEYA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Any news? The issue happening |
Having this issue as well. Have to upgrade and target sdk 34 in 45 days. Is there any news on this? |
Any news on this?? I am still seeing this issue |
I'm also facing the same issue. any updates |
Any updates on this issue? |
Android 14 users of my production app is facing problems. App is stuck on startup as i am using this package to fetch secure values. After clearing the cache manually it start working. Ps:- We cant tell all the users to delete cache and run app. This is very bad. |
This is a problem for us too |
@mogol I think we might need to re-open this issue. |
@dishankjindal1 How are you having them clear cache? |
@bryan1anderson There’s another (already open) issue for this actually, #354. I opened it because this one was closed, so it’s still being tracked fwiw. |
Based on the updates there, it might be fixed in an upcoming rewrite |
Problem described in #161 still occurrs in 3.3.5.
In my case for:
Samsung S8 (Android 8)
Some others mention this behavior for:
The text was updated successfully, but these errors were encountered: