question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:29 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
luizmellocommented, Jan 19, 2017

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.

1reaction
joxadcommented, May 29, 2016

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Model object<Model.class> is not registered with a Database ...
TestMember is not registered with a Database. Did you forget an annotation? at com.raizlabs.android.dbflow.config.FlowManager.
Read more >
DBFlow Guide | CodePath Android Cliffnotes
ProGuard issues. If you are using DBFlow with ProGuard, and see Table is not registered with a Database. Did you forget the @Table...
Read more >
Spring Data R2DBC - Reference Documentation
For Java configuration, you can use the queryLookupStrategy attribute of the EnableJpaRepositories annotation. Some strategies may not be ...
Read more >
Hibernate One To Many Mapping Example Annotation
We can use foreign key constraint for one to many mapping. Below is our database script for Cart and Items table. I am...
Read more >
Key annotations you need to know when working with JPA ...
By default, each entity class maps a database table with the same name in the default schema of your database. You can customize...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found