juliansteenbakker / flutter_secure_storage

A Flutter plugin to store data in secure storage
https://pub.dartlang.org/packages/flutter_secure_storage
BSD 3-Clause "New" or "Revised" License
1.13k stars 391 forks source link

flutter_scure_storage does not work with android studio lady bug #806

Open ssarhangi opened 1 month ago

ssarhangi commented 1 month ago

When I upgraded my android studio to lady bug from koala, flutter_secure_storage would bomb the android emulator and project would not compile and run on android. I had to uninstall ladybug and go back to koala

DangTuCS commented 1 month ago

I am facing the same issue. Are there any solutions yet? I don't want to downgrade to Koala because I’ve already made many changes.

ssarhangi commented 1 month ago

I haven't found any. So I took the path of least resistance and downgraded to koala, which targets jdk(java) version 17. That fixed it for me. I spent a day trying other hacks but nothing worked.

jokigenki commented 1 month ago

We have the same issue, although the project builds correctly in Android Studio itself (after running all of the suggested upgrade steps), it does not work from IntelliJ. The errors we are getting are:

ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in C:\Users\owen\Documents\Projects\Yodobashi\yds-design-system\yds_design_system\yodobashi_point_app\example\example-point-app\build\app\outputs\mapping\release\missing_rules.txt.
ERROR: R8: Missing class com.google.errorprone.annotations.CanIgnoreReturnValue (referenced from: com.google.crypto.tink.KeysetManager com.google.crypto.tink.KeysetManager.add(com.google.crypto.tink.KeyTemplate) and 52 other contexts)
Missing class com.google.errorprone.annotations.CheckReturnValue (referenced from: com.google.crypto.tink.InsecureSecretKeyAccess and 1 other context)
Missing class com.google.errorprone.annotations.Immutable (referenced from: com.google.crypto.tink.InsecureSecretKeyAccess and 40 other contexts)
Missing class com.google.errorprone.annotations.RestrictedApi (referenced from: com.google.crypto.tink.aead.AesEaxKey$Builder com.google.crypto.tink.aead.AesEaxKey.builder() and 6 other contexts)      
Missing class javax.annotation.Nullable (referenced from: java.lang.Object com.google.crypto.tink.PrimitiveSet$Entry.fullPrimitive and 86 other contexts)
Missing class javax.annotation.concurrent.GuardedBy (referenced from: com.google.crypto.tink.proto.Keyset$Builder com.google.crypto.tink.KeysetManager.keysetBuilder and 3 other contexts)

We have tried adding these classes to proguard-rules.pro as suggested by the compiler, but this did not fix the error. Commenting this package out of our code allows it to build.

SugiKent commented 1 month ago

@ssarhangi ssarhangi I had same issue on Koala. When I wrote proguard rules like below issue mentioned, the errors are fixed. https://github.com/mogol/flutter_secure_storage/issues/748

ssarhangi commented 1 month ago

@SugiKent Thanks, I will try that.