December 31, 2018

Android Room: room Entity class must be annotated with @Entity

If you run into the following error you probably provide a class that is either not correctly annotated or shouldn’t be there.

The source of this problem usually can be found by looking at your database class, the example code is in Kotlin but should also apply to Java:

Now make sure, that any referenced class in the @Database annotation in line 1 is annotated with @Entity.

Related Posts

Avatar photo

theCodeCampus
Developer at thecodecampus </>

Our knowledge is not simply gained through reading - it is trained, tested and constantly being expanded. Because first and foremost, we are all developers at W11K. The know-how that we acquire here as developers, consultants and information architects flows immediately into our training courses and articles for theCodeCampus.


Leave a Reply

Add code to your comment in Markdown syntax.
Like this:
`inline example`

```
code block
example
```

Your email address will not be published.