ORMLite error no databasefield annotations exists

前端 未结 3 760
一向
一向 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:42

    This turned out to be a bug in ORMLite around foreign object loops that was fixed in version 4.22. ORMLite was not properly handing the case where A has a foreign-field B which has a foreign-field to C which has a foreign-field back to A..

    http://ormlite.com/releases/

    Please send me some direct mail @Yanny if this does or doesn't work and I will tune this answer accordingly.

    0 讨论(0)
  • 2021-01-24 09:47

    Could you check, are created table Vak in your DB? The absence of this table can be reason of this crash.

    0 讨论(0)
  • 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.**<br> -keepclassmembers class com.j256.** { *; }<br> -keep enum com.j256.**<br> -keepclassmembers enum com.j256.** { *; }<br> -keep interface com.j256.**<br> -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..

    0 讨论(0)
提交回复
热议问题