DBFlow: Table is not registered with a Database. Did you forget the @Table annotation?

Hello.

I’m trying to use DBFlow version 3.0.0-beta5 in a project that uses

  • Dagger 2.2
  • DBFlow v3.0.0-beta5
  • Glide v3.7.0
  • Retrofit v2.0.0
  • Couple other small libraries for small utility stuff like AndroidViewAnimations.

I often times get the following exception:

com.raizlabs.android.dbflow.structure.InvalidDBConfiguration: Table: com.levibostian.app.UserModel is not registered with a Database. Did you forget the @Table annotation?

This is not consistent, but happens very often, cleaning and rebuilding the app usually doesn’t help (but sometimes does).

I have checked out this issue which talks about disabling instant run, which I have done with same result of it happening most of the time, but not every single time.

I have also checked out this issue which talks about using gradle clean from command line instead of in Android Studio. I have been doing ./gradlew clean and reinstalling my app every build (even if I do not edit any of the DBFlow touching code in my project) and no change of behavior either.

Like I mentioned before, I am receiving this regularly but not every time. Maybe 75% of the time? The stacktrace triggers on this line of code:

mFlowCursorList = new FlowCursorList<UserModel>(false, SQLite.select().from(UserModel.class).where(UserModel_Table.responded.isNull()).orderBy(UserModel_Table.user_id, true));

in my adapter class which may be the first part of interaction with my Model classes. When the app does run the 25% of the time, it runs great with no issues.

Any help, please and thank you.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 29 (12 by maintainers)

Most upvoted comments

I was with this issue, but for me after change the Gradle “android-apt plugin” to the “annotationProcessor” and update Dagger to version 2.8. the problem gone.

For me it fails every time if everything kotlin. I make it working this way :

Model class in java. Application class in java. The other classes in kotlin.

I tested this sample from jetbrain : https://github.com/JetBrains/kotlin-examples/tree/master/gradle/android-dbflow but it doesn’t work