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.

Imports not working with Kotlin

See original GitHub issue

I started to convert all of my code to Kotlin and I noticed that whenever I try to invoke Objectbox related properties (generated files) it gives me compile time error Unresolved reference : ___. Even though the imports work but the project wont compile. As a workaround I use static java helper class. So is this going to be fixed any time soon?

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
aarajputcommented, Jan 21, 2018

Add this line. It will solve your problem. apply plugin: ‘kotlin-kapt’

4reactions
greenrobot-teamcommented, May 23, 2017

A workaround is to manually include the objectbox generated source folder:

android {
    ...
    sourceSets {
        main.java.srcDirs += 'build/generated/source/objectbox'
    }
}

-ut

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kotlin compiler cannot find imports - Support
If you just give it a single file as an argument, it won't be able to import any other files. My file structure...
Read more >
Android Studio: Import not being recognized - kotlin
It just seems that you have added a few imports from the java packages instead of the android packages. It can happen when...
Read more >
Unable to import Kotlin classes (from libraries) on Kotlin classes
I can't import Kotlin classes from libraries on another kotlin class, but if I try to import on a Java class it works...
Read more >
Imports and packages - Kotlin Quick Reference
There is no import static syntax; You can rename a class when you import it; The import statement is not restricted to only...
Read more >
auto import not working for compose : r/Kotlin - Reddit
Sure, in your head, you might know that remember refers to androidx.compose.runtime.remember , but it's not that uncommon to have multiple ...
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