flutter_secure_storage
flutter_secure_storage copied to clipboard
FATAL EXCEPTION: com.it_nomads.fluttersecurestorage.worker
Hello,
I just updated our app to flutter 3.24.1 and flutter_secure_storage 9.2.2, but when I run the app in release mode I get:
➜ app git:(main) ✗ flutter run --release --flavor=production
Launching lib/main.dart on SM S918B in release mode...
I/flutter (17402): STARTING WIDGET UPDATE
Running Gradle task 'assembleProductionRelease'... 150.0s
✓ Built build/app/outputs/flutter-apk/app-production-release.apk (40.9MB)
Installing build/app/outputs/flutter-apk/app-production-release.apk... 2,544ms
Flutter run key commands.
h List all available interactive commands.
c Clear the screen
q Quit (terminate the application on the device).
E/AndroidRuntime(17849): FATAL EXCEPTION: com.it_nomads.fluttersecurestorage.worker
E/AndroidRuntime(17849): Process: com.my.example, PID: 17849
E/AndroidRuntime(17849): java.lang.ExceptionInInitializerError
E/AndroidRuntime(17849): at L7.f.a(DeterministicAeadConfig.java:20)
E/AndroidRuntime(17849): at L7.f.<clinit>(DeterministicAeadConfig.java:8)
E/AndroidRuntime(17849): at androidx.security.crypto.a.a(EncryptedSharedPreferences.java:5)
E/AndroidRuntime(17849): at d9.a.j(FlutterSecureStorage.java:53)
E/AndroidRuntime(17849): at d9.a.f(FlutterSecureStorage.java:35)
E/AndroidRuntime(17849): at d9.a.b(FlutterSecureStorage.java:1)
E/AndroidRuntime(17849): at d9.d$b.run(FlutterSecureStoragePlugin.java:226)
E/AndroidRuntime(17849): at android.os.Handler.handleCallback(Handler.java:958)
E/AndroidRuntime(17849): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(17849): at android.os.Looper.loopOnce(Looper.java:230)
E/AndroidRuntime(17849): at android.os.Looper.loop(Looper.java:319)
E/AndroidRuntime(17849): at android.os.HandlerThread.run(HandlerThread.java:67)
E/AndroidRuntime(17849): Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: S7.I.values []
E/AndroidRuntime(17849): at java.lang.Enum.enumValues(Enum.java:313)
E/AndroidRuntime(17849): at java.lang.Enum.-$$Nest$smenumValues(Unknown Source:0)
E/AndroidRuntime(17849): at java.lang.Enum$1.create(Enum.java:320)
E/AndroidRuntime(17849): at java.lang.Enum$1.create(Enum.java:318)
E/AndroidRuntime(17849): at libcore.util.BasicLruCache.get(BasicLruCache.java:63)
E/AndroidRuntime(17849): at java.lang.Enum.getSharedConstants(Enum.java:332)
E/AndroidRuntime(17849): at java.lang.Class.getEnumConstantsShared(Class.java:4118)
E/AndroidRuntime(17849): at java.util.EnumMap.getKeyUniverse(EnumMap.java:749)
E/AndroidRuntime(17849): at java.util.EnumMap.<init>(EnumMap.java:136)
E/AndroidRuntime(17849): at L7.e.<clinit>(AesSivProtoSerialization.java:76)
E/AndroidRuntime(17849): ... 12 more
E/AndroidRuntime(17849): Caused by: java.lang.NoSuchMethodException: S7.I.values []
E/AndroidRuntime(17849): at java.lang.Class.getMethod(Class.java:2950)
E/AndroidRuntime(17849): at java.lang.Class.getDeclaredMethod(Class.java:2929)
E/AndroidRuntime(17849): at java.lang.Enum.enumValues(Enum.java:310)
E/AndroidRuntime(17849): ... 21 more
Did anybody encounter this or is there a fix for it? Are there any specific proguard rules I should add?
The error appears whenever I call a flutter secture storage method.
Thanks
Just tried to build with minifyEnabled false and then it works perfectly fine.
Tried to add
-keep class androidx.security.crypto.** { *; }
-keep class com.it_nomads.fluttersecurestorage.** { *; }
to the proguard rules, but that does not seem to be enough in minify mode.
i got the same issue , have solved?
I also have the same error with the device SM-S918B
Could you please try again with version 9.2.3 or with version 10.0.0-beta.1? If the issue still exists, please let me know so i can look into it.
What is the conclusion on this issue ? Tried to use the beta version but the same thing happens.
For now we added this rule to the proguard file:
-keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); }
i got the same issue , have solved?