2012-10-04 20 views
5

Ứng dụng của tôi hoạt động hoàn hảo mà không cần bảo vệ. Khi tôi sử dụng proguard với ormlite, tôi có một số vấn đề. Trong logcat xuất hiện:Proguard with orrmlite - Bộ sưu tập tham số

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

trong tập tin Proguard tôi đặt:

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

Ông có thể giúp tôi? Cảm ơn

Trả lời

13

tôi đã tìm thấy bạn cần phải giữ nhiều hơn chỉ là Chú thuộc tính

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

Dưới đây là báo cáo ormlite Proguard mặc định của tôi. Bạn cũng cần giữ các tệp mô tả dữ liệu của mình cũng như

# 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.** { *; } 
Các vấn đề liên quan