I am trying to implement Proguard for my Android project. Am using Android Studio for doing the same. But finding lot of difficulties while implementation. Is there a good tutorial to overcome all the issues. In the below code which I have used got an exception like cannot be cast. Can anyone help me to get rid of this issue.
In my proguard-rules.txt I have used the below lines too. But it dint resolve my issue
-keep class com.google.gson.**{*;}
-dontwarn com.google.gson.**
public class Home_CityDet implements Serializable{
private static final long serialVersionUID = 1L;
@SerializedName("key")
public String key;
@SerializedName("value")
public String value ;
}
java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to webservices.responses.Home_CityDet
I had to add to the progaurd configuration:
-keepattributes Signature
-keepattributes *Annotation*
-keep class Home_CityDet {
*;
}
and the error magically disappeared
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