android - Proguard removing ORMLite annotation in just one field -


i have class

@databasetable(tablename = helloworld.table_name) public class helloworld {  public static final  string table_name = "hello_world";  public static final  string col_id     = "id";  public static final  string col_text   = "text";  private static final string col_subtext = "subtext";  @databasefield(columnname = col_id, generatedid = true) private int    mid;  @databasefield(columnname = col_text, uniquecombo = true) private string mtext;  @databasefield(columnname = col_subtext, uniquecombo = true) private string msubtext;  public helloworld() { }  public helloworld(string text, string subtext) {     mtext = language;     msubtext = subtext; }  public string gettext() {     return mtext; } } 

this happens: when run android app in debug mode fine. when in release conf, proguard taking out @databasefield annotation id field. query:

final list<helloworld> helloworld = mhelloworlddao.querybuilder()                                                                         .orderby(helloworld.col_id, true)                                                                         .where()                                                                         .eq(helloworld.col_text, "hello")                                                                         .query(); 

this exception:

java.lang.illegalargumentexception: unknown column name 'id' in table hello_world 

i tried enable proguard in debug , try debug ormlite. basically, when it's time create dao, ormlite looks annotated fields. in case, it's able text , subtext fields, when looks annotations in id fields doesn't find annotation.

this proguard conf:

    # ormlite -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.almworks.** -keepclassmembers class com.almworks.** { *; } -dontwarn com.j256.** -dontwarn com.almworks.** -keepattributes *annotation* 

am missing something? there strange rule involved?

edit:

if add getters , setters id field, working. event if not used. don't solution. anyway, there should rule below it.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -