Android application crashes if proguard is used for obfuscating. Below is the stacktrace.
Caused by: java.lang.IllegalArgumentException: Internal error:
TypeReference constructed without actual type information
at a.b.a.g.b.<init>(TypeReference.java:35)
at a.c.d.q.<init>(StdCouchDbInstance.java:22)
at a.c.d.p.<clinit>(StdCouchDbInstance.java:22)
I am using the EktorpClient
library(To work with the couchdb) and StdCouchDbInstance.java
refers to this file and TypeReference.java
is in this package. Any suggestion as to what option I should use in the Proguard config file to overcome this problem?
I just ran into this problem using Proguard with an Ektorp dependency. The TypeReference is a generic, and -keepattributes Signature
will keep generic information.
I actually used the following, which solved my issue.
-keepattributes Signature,*Annotation*,EnclosingMethod
From the Proguard Examples:
The "Signature" attribute is required to be able to access generic types when compiling in JDK 5.0 and higher.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With