2
我有问题,我的项目启用的ProGuard: 值java.sql.SQLException:无法删除类ADC,因为它没有一个ID字段定义Ormlite使用ProGuard启用没有找到id字段
ADC类在exepction提到后跟:
@DatabaseTable(tableName = "zaplanowane_zlecenie")
public class ZaplanowaneZlecenie {
@DatabaseField(generatedId = true)
private UUID mZaplanowaneZlecenieId;
@DatabaseField(columnName = "data")
private DateTime mZaplanowanaData;
@DatabaseField(dataType = DataType.SERIALIZABLE)
private ZlecenieFiltrowane mZaplanowanyAdres;
@DatabaseField
@Nullable
private Double mLatitude;
@DatabaseField
@Nullable
private Double mLongitude;
的时刻,问题是:
mPlannedRepo.deleteForDate(mSelectedData);
代码很简单 - 删除收集发现mDao.quer yForEq 虽然我没有使用proguard,但这些方法运行良好。但是,如果我启用proguard,我已经提到异常,我的代码不起作用。
我proguard的文件(片段与OrmLite):
# ORMLite uses reflection
-keepattributes *DatabaseField*
-keepattributes *DatabaseTable*
-keepattributes *SerializedName*
-keep class com.j256.**
-keepclassmembers class com.j256.** { *; }
-keep enum com.j256.**
-keepclassmembers enum com.j256.** { *; }
-keep interface com.j256.**
-keepclassmembers interface com.j256.** { *; }
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
# Keep the helper class and its constructor
-keep class * extends com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper
-keepclassmembers class * extends com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper {
public <init>(android.content.Context);
}
请帮帮忙!我不知道这里发生了什么。
我会添加最后几行http://stackoverflow.com/questions/9853096/proguard-with-ormlite-on-android#answer-31582883 ...顺便说一句。混合波兰语和英语变量的名称是不是一个好的做法 – Selvin
谢谢,它帮助:D – masztalski