1

我很难让 Ormlite 与 Proguard 一起工作,它不断产生新的错误。我目前卡在以下错误消息上,有人有解决方案吗?

" android.database.sqlite.SQLiteException: no such column: region.name (code 1): , while compiling: SELECTarea .* FROMarea INNER JOINregion ONarea .region_id =region .a ORDER BY region.name ASC"

Proguard 配置

##---------------Begin: proguard configuration for Ormlite  ----------
-libraryjars libs/ormlite-android-4.42.jar 
-libraryjars libs/ormlite-core-4.42.jar 

-keepattributes Signature
-keep class <packagename>.db.** { *; }

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

2 回答 2

2

将 columnName 添加到 DatabaseField 注释解决了我的问题。@DatabaseField(列名 = "")

于 2013-07-01T08:30:46.553 回答
0

添加keepclassmembers到您的模型类:

-keepclassmembers class <packagename>.db.** { *; }
于 2015-04-06T13:02:54.790 回答