External class in Kotlin project can't be resolved when using Kotlin, but can be resolved when using Java

Answered

I'm having the exact same issue again since the original post (https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003908680-External-class-in-Kotlin-project-can-t-be-resolved-when-using-Kotlin-but-can-be-resolved-when-using-Java?page=1#community_comment_360001079160). I've tried restarting my PC and invalidating caches, deleting the .idea and .iml file, and have tried deleting the LocalHistory and caches folder (there was one other folder too, forgot what it's called) nothing has worked.

Running IntelliJ Ultimate 2019.3 stable build, I have also tried disabling every plugin but Kotlin and .ignore, still not importing correctly.

The project compiles on my PC with Maven fine in the same project directory and it also compiles fine on the CI server I have setup for this project. I have a remote repository defined in the POM which 100% works fine also and I can download artifacts from the server just fine. I'm using Maven 3.6.1. I've also tried nuking the local repository folder (in the .m2 folder) and hasn't worked.

To clarify, the dependency is imported just fine in the POM and on the dependencies list (in the "external libraries" section) there's no red lines or anything. Every other dependency imports fine besides one; this dependency is 99% Kotlin code and everything else is 100% Java, so I'm certain it's something to do with the original issue (not being able to use external Kotlin classes inside Kotlin classes).

The project I am using is "UHC" (main package is "rip/paragon/uhc") and the dependency I am trying to use (which is 99% Kotlin code) is "Base" ("rip/paragon/base")

I have uploaded the log file to the HTTPS service (https://uploads.services.jetbrains.com/) the file name is "idea-support-case-kt.log"

0
2 comments

Update: I uninstalled all of my JetBrains IDE's (I had many of them installed standalone) and installed the Toolbox app. I'm still facing this issue. When using Java code, it can find the classes of the external dependency, but when using Kotlin, it can't.

0

Update: fixed, turns out another dependency I had that is also on the same repository server didn't have a POM with the JAR file, which was also the error when trying to install through the Maven side-panel, but IntelliJ just ignores it.

0

Please sign in to leave a comment.