agrosner / DBFlow

A blazing fast, powerful, and very simple ORM android database library that writes database code for you.
MIT License
4.87k stars 598 forks source link

Model object: <classname> is not registered with a Database. Did you forget an annotation? #1035

Closed TeddyGammel closed 7 years ago

TeddyGammel commented 7 years ago

DBFlow Version: 3.1.1 Issue Kind (Bug, Question, Feature): InvalidDBConfiguration

Description:

I have a class that extends from BaseModel which also has the @Table annotation. This annotation includes the database class with the @Database annotation in it. Instant run on my studio is disabled. I am using Android studio 2.2.1 with gradle version 2.1.3. I did look at issue 515, but the solution there does not help me.

Kindly let me know where I have gone wrong. Thank you.

TeddyGammel commented 7 years ago

@agrosner , request your help in this issue. Thank you.

TeddyGammel commented 7 years ago

@agrosner , Got to know that the Application class name should be mentioned in the manifest file. However I am trying to build this in an android library project and not in an application project. Can i not run the dbflow library in a library project?

agrosner commented 7 years ago

sorry for late reply. Yes library projects are supported, if you could kindly try 4.0.0-beta3 and let me know if the issue still persists. https://github.com/Raizlabs/DBFlow/blob/master/usage2/MultipleModules.md

AyoPrez commented 7 years ago

I'm facing the same problem. I'm using a library to build the database with dbflow 4.0.0-beta3. The Application class is abstract in the library, so in the main app I'm adding the main app's application class name in the main app's manifest file, but not in the library manifest because the application class there is abstract. How should I manage this situation @agrosner?

I have tried the multi module thing putting in the main app's gradle file the right text with the name of the module and in the initialization of the library in the application class starting as well the "GeneratedDataHolder.class", but it doesn't work for me.

BTW, my library has a hyphen in the nema and it's look like there is some problem generated the "library-nameGeneratedDataHolder.class"

axellebot commented 7 years ago

@AyoPrez After one month, how you handled it ? I'm facing the same problem with CleanArchitecture (3 module : app, domain, presentation)

goonerDroid commented 6 years ago

@AyoPrez @axellebot Any update on this issue?

raphaelbgr commented 5 years ago

Facing the same problem

axellebot commented 5 years ago

It looks like I switched to GreenDao :/ http://greenrobot.org/greendao/