IllegalStateException: TypeToken must be created when using GSON 2.10.1 and R8 on Android #2646
Labels
bug
proguard-r8
Issues relating to the use of ProGuard and/or R8, such as problems due to obfuscation
Gson version
2.10.1
Java / Android version
Java 17, Android 34
Description
I just updated my Android project to use latest GSON library 2.10.1 and I am getting following exception, when using this library on Android project with AGP 8.1 and R8 enabled.
Per this stackoverflow thread I need to add additional rules -- https://stackoverflow.com/questions/76224936/google-gson-preserve-generic-signatures
Perhaps a naive question -- shouldn't these rules be packaged with the library?
As consumer of GSON library, do I still need to explicitly include rules specified here in the file below, as far as I can tell those changes are merged.
https://github.com/google/gson/blob/main/gson/src/main/resources/META-INF/proguard/gson.pro
The text was updated successfully, but these errors were encountered: