Closed atlantis0 closed 1 year ago
Hey @atlantis0 thank you for the excellent bug report. We'll work on getting out an updated consumer proguard file out, but in the meantime anyone encountering this should use the first listed workaround, add this line to your proguard file:
-keep class com.amazonaws.auth.AWS4Signer { *; }
A fix has been released in version 2.71.0. Please let us know if you have any additional questions.
Describe the bug App crashes when using AWS core SDK with AGP 8.0. AGP 8.0 was released in April 2023 with breaking changes as described here, https://developer.android.com/build/releases/gradle-plugin#default-changes
See crash stack trace
To Reproduce
Here is link to the full project, https://drive.google.com/file/d/1snapMz2QLcmCnhZbBrcVnx5zHrBaih3k/view?usp=sharing
Which AWS service(s) are affected? AWS Auth with Cognito
Expected behavior App should not crash in release mode when using AWS auth Cognito and AGP 8+
Environment Information (please complete the following information):
Additional context AGP 8.0 sets android.enableR8.fullMode=true as its default value. fullMode aggressively optimizes classes that use reflection. The documentation explicitly states, "Classes that are only instantiated using reflection should be kept explicitly with a -keep rule.". See here, https://r8.googlesource.com/r8/+/refs/heads/master/compatibility-faq.md#r8-full-mode
Since,
com.amazonaws.auth.AWS4Signer
is used reflectively, the appropriate proguard rule should be created for it. E.g like thisWork Around Two options
android.enableR8.fullMode=false
Edit - Formatting