2012-10-04 23 views
5

La mia app funziona perfettamente senza proguard. Quando uso proguard con ormlite, ho alcuni problemi. Nella logcat appaiono:Proguard con orrmlite - Collezione parametrizzata

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

Nel file di Proguard ho messo:

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

Mi può aiutare? Grazie

risposta

13

che ho trovato è necessario per mantenere più di una semplice annotazione attributo

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

Sotto è il mio dichiarazioni ormlite Proguard predefinite. È necessario conservare i file che descrivono i dati anche

# 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.** { *; }