Architecture-samples: Private property in Task entity "Cannot find getter"

Created on 4 Dec 2017  ·  6Comments  ·  Source: android/architecture-samples

I get "Cannot find getter" for the fields with the following libraries.

annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
implementation 'android.arch.persistence.room:runtime:1.0.0'

When I changed the Entity properties to public everything worked. What is the relevance of private & public properties for Entities annotated with @Entity.

Most helpful comment

@iraj-wisilica i used to have the same problem, i just rename the variable and it works, i don't know why, but it works

All 6 comments

What is the relevance of private & public properties for Entities annotated with @entity.?

Entities need to have getters for private members.
Check out the documentation for details.

@florina-muntenescu Thanks for the info.

@iraj-wisilica i used to have the same problem, i just rename the variable and it works, i don't know why, but it works

Worked here too. I have absolutely no idea why.

I exactly faced with same issue and It works another computer but not in mine.
So weird. According to @chamakov and @iraj-wisilica responses, I tried change the name from "id" to "workerId" and it works. WEIRD!

Was this page helpful?
0 / 5 - 0 ratings