Skip to content Skip to sidebar Skip to footer

Proguard - Persistenceexception: Constructor Not Matched For Class

I am using retrofit2.0 in my app with simpleframework.xml library. The problem is when I run the app without proguard it works fine however when I run proguard I get the following

Solution 1:

I guess that your problem is that you are not keeping any attributes and that obviously depends in which attributes you are using. In my case, this is how I dealt with it, let me know if it works for you:

## https://square.github.io/retrofit/ ##
-dontwarn retrofit2.**-keep class retrofit2.** { *; }-keepattributes Signature-keepattributes Exceptions
 -keepclasseswithmembers class * {
    @retrofit2.http.* <methods>;
}

## Simple XML ##
-dontwarn org.simpleframework.xml.stream.**-keep public class org.simpleframework.** { *; }-keep class org.simpleframework.xml.** { *; }-keep class org.simpleframework.xml.core.** { *; }-keep class org.simpleframework.xml.util.** { *; }-keepattributes ElementList, Root, *Annotation*-keepclassmembers class * {
    @org.simpleframework.xml.* *;
}

Solution 2:

try adding these below lines in your proguard file. It should solve your problem

-dontnote retrofit2.Platform-keepattributes Signature-keepattributes Exceptions

and remove these below lines

-dontwarn retrofit2.**-keep class retrofit2.** { *; }

Post a Comment for "Proguard - Persistenceexception: Constructor Not Matched For Class"