question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compile error if ID property is private and has no setter/getter

See original GitHub issue

ObjectBox 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)
......
111

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
markdrakecommented, Mar 12, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found