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