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.

fields has private access in .kt class

See original GitHub issue

Please help us to fix issues asap: to reduce checking with you back and forth, use the template below. Replace italic sections with your input. For support questions, please use stackoverflow with the [objectbox] tag - we get notified.

Basics

  • ObjectBox version (are using the latest version?): 1.0.0
  • Reproducibility: [always]

Reproducing the bug

Description

@greenrobot I started using this but during build entities i have got below error from generated cursor.java class

Code

var addressLocationBox: ToOne<SNDBAddressLocationBox>? = null

collect313311(cursor, 0, 0, 0, null, 0, null, 0, null, 0, null, __ID_addressForeignKeyId, entity.addressForeignKey.getTargetId(), _ __ID_operationInQueue, entity.getOperationInQueue(), __ID_priority, entity.getPriority(), __ID_status, entity.getStatus(), 0, 0, 0, 0);

Logs & stackstraces

Error:(90, 50) error: addressLocationBox has private access in AddressBox

Entities

AddressBox.kt

Issue Analytics

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

github_iconTop GitHub Comments

8reactions
greenrobotcommented, Sep 9, 2017

@sigfridod Thanks for reporting, will look into this very soon.

As a workaround, you should be able to make the Kotlin field visible using @JvmField:

@JvmField var addressLocationBox: ToOne? = null

Does that help for now?

0reactions
greenrobot-teamcommented, Mar 4, 2019

@bhuvaneshwariarkala This is also explained in more detail in the docs: https://docs.objectbox.io/relations -ut

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessing Kotlin class object from Java - Stack Overflow
I have a Kotlin class which has a class object, e.g. ... If I'm using this class from Java, how do I access...
Read more >
protected var "has private access" unless declared as lateinit
Backing fields of non-lateinit Kotlin properties are always private. Subclasses can access the value of the property through a getter: getMyProject().getBaseDir ...
Read more >
Visibility modifiers - Kotlin
private means that the member is visible inside this class only (including all its members). protected means that the member has the same ......
Read more >
Creating Java static final Equivalents in Kotlin - Baeldung
If you have a few years of experience with the Kotlin language and ... doesn't expose Kotlin fields as public for Java classes...
Read more >
How to create static methods and classes in Kotlin
Similarly, to invoke a static method, we just have to know its name, ... In Java, classes may easily declare static fields or...
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