2012-10-04 26 views
5

我的應用完美無缺地運行。當我用ormlite使用proguard時,我遇到了一些問題。在logcat的出現:帶orrmlite - 參數化收藏的Proguard

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

在proguard的文件,我把:

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

你能幫助我嗎? 感謝

回答

13

我找到你需要保持不僅僅是註釋更屬性

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

下面是我的默認ormlite proguard的語句。您需要保留描述您的數據的文件以及

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