Compile error if ID property is private and has no setter/getter
See original GitHub issueObjectBox version: 1.4.4 Gradle tools version: 3.1.1 AndroidStudio version: 3.1.1
Manually Add Libraries
dependencies {
implementation "io.objectbox:objectbox-android:1.4.4"
annotationProcessor "io.objectbox:objectbox-processor:1.4.4"
}
When I add annotating one class with @Entity, then I make project, the following error occurred:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
......

Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
c# - Property with getter only vs. with getter and private setter
Case 1: With no setter, an auto-implemented property can only be set while declaring the property or inside the constructor as a backing ......
Read more >Best Practices for Java Getter and Setter - DZone
Mistake #1: You have setter and getter, but the variable is declared in a less restricted scope. ... The variable firstName is declared...
Read more >@Data - Project Lombok
@Data is a convenient shortcut annotation that bundles the features of @ToString , @EqualsAndHashCode , @Getter / @Setter and @RequiredArgsConstructor ...
Read more >Kotlin properties do not override Java-style getters and setters
I think it's because of "On JVM: Access to private properties with default getters and setters is optimized to avoid function call overhead....
Read more >Java Getter and Setter Tutorial - from Basics to Best Practices
How to write getter and setter methods in Java with in-depth description, ... obj.number = 10 ; // compile error, since number is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This issue was happening to me on version 2.3.3 using Kotlin, this was because I was using data classes like this:
data class Entity(@Id val id: Long)
just change it to:
data class Entity(@Id var id: Long)
and works like a charm.
@markdrake https://docs.objectbox.io/kotlin-support
-Uwe