2012-10-04 10 views
5

私のアプリはプロガードなしでも完璧に動作します。 ormliteでproguardを使用すると、いくつか問題があります。 logcatに表示されます。ProGuardのファイルでorrmliteでパラメータを設定したProguard

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

を私が入れ:

-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.** { *; } 
関連する問題