Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proguard with orrmlite - parameterized Collection

My app works perfectly without proguard. When I use proguard with ormlite, I have some problems. In the logcat appear:

java.sql.SQLException: Field class for 'name' must be a parameterized Collection

In proguard file I put:

-keep class com.j256.** 
-keepclassmembers class com.j256.** { *; }
-keep enum com.j256.**
-keepclassmembers enum com.j256.** { *; }
-keep interface com.j256.**
-keepclassmembers interface com.j256.** { *; }

Could you help me? Thanks

like image 910
MARM Avatar asked Oct 04 '12 14:10

MARM


1 Answers

I've found you need to keep more than just the Annotation attribute

-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod 

Below is my default ormlite proguard statements. You need to keep the files that describe your data as well

# OrmLite uses reflection
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod 
-keep class com.j256.**
-keepclassmembers class com.j256.** { *; }
-keep enum com.j256.**
-keepclassmembers enum com.j256.** { *; }
-keep interface com.j256.**
-keepclassmembers interface com.j256.** { *; }

-keep class com.mycompany.myproduct.data.entity.**
-keepclassmembers class com.mycompany.myproduct.data.entity.** { *; }
-keep enum com.mycompany.myproduct.data.entity.**
-keepclassmembers enum com.mycompany.myproduct.data.entity.** { *; }
-keep interface com.mycompany.myproduct.data.entity.**
-keepclassmembers interface com.mycompany.myproduct.data.entity.** { *; }
like image 196
RobCroll Avatar answered Oct 29 '22 06:10

RobCroll