android / architecture-samples

A collection of samples to discuss and showcase different architectural tools and patterns for Android apps.
Apache License 2.0
44.36k stars 11.62k forks source link

Private property in Task entity "Cannot find getter" #473

Closed iraj-wisilica closed 6 years ago

iraj-wisilica commented 6 years ago

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.

iraj-wisilica commented 6 years ago

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

florina-muntenescu commented 6 years ago

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

iraj-wisilica commented 6 years ago

@florina-muntenescu Thanks for the info.

chamakov commented 6 years ago

@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

AyokunlePaul commented 6 years ago

Worked here too. I have absolutely no idea why.

emretekin commented 4 years ago

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!