ORMLite error no databasefield annotations exists

前端 未结 3 763
一向
一向 2021-01-24 09:22

I have this error when I run my Android application:

No fields have a DatabaseField annotation in class [[Lmodel.Vak;

My class Vak

3条回答
  •  清歌不尽
    2021-01-24 09:47

    It's probably late for giving solution but this is my solution:
    you see proguard try to obfuscating the code and if you read proguard in depth or intro

    http://proguard.sourceforge.net/FAQ.html

    what Shrinking in proguard -> Shrinking programs such as ProGuard can analyze bytecode and remove unused classes, fields, and methods. so from this we can presume that it is removing your objects since it's not used by anywhere...
    so wt you probably need? you need to stop proguard from shirking that methods or objects from process so this is the line for that..:
    -keep class com.j256.**
    -keepclassmembers class com.j256.** { *; }
    -keep enum com.j256.**
    -keepclassmembers enum com.j256.** { *; }
    -keep interface com.j256.**
    -keepclassmembers interface com.j256.** { *; }


    this line will keep proguard from removing my public methods and variables..

    -keepclassmembers class classpath.** { public *; }
    you need to write column name for atlest id... because it will search for it and will proguard change it's name... so you need to define column name id for primary key..

提交回复
热议问题