I apologise if this has been brought up before, bu...
# intellij
s
I apologise if this has been brought up before, but after updating intellij to 2018.2 and kotlin to 1.2.51 (or higher) a dependency that I compiled with Kotlin doesn't seem to get recognised in my current project when writing in .kt, but if i write in .java the references to the dependency are recognised
c
So, gradle build works while IntelliJ build doesn't?
s
yes
c
have you tried Main Menu:
Build
Rebuild Project
after synchronizing gradle?
s
Invalidate caches & restart also helps sometimes
s
Yeah, it's weird because it's just this one dependency's classpath that fails to be recognised in my project. I've looked in the dependencies under project structure and it recognises the jar, i looked in the jar and all the classes are there, which means the jar its fetching is fine.
I have tried invalidating cache, no luck
d
Can you share the project, or it is closed-source?
s
I don't think many people have come across this seeing the lack of answers. I'll have to resort to backtracing my steps and reporting the bug. The dependency is open source, but the project having the problem with dependency is closed
Compiles fine, runs fine.
I'd like to make it clear this problem is only happening when I'm writing a .kt file, but if its a java file classpath is recognised fine. Which makes me believe this is certainly a problem with the kotlin plugin, not any of the project configs
d
Sure, but it may be the case that project configuration for some reason is not understood well by the Kotlin plugin. IDE resolve isn't only about classpath -- one thing that can also mess here is modular system (projects in Gradle)
s
Hey @dsavvinov et al, I've finally been able to fix the problem. I've been ignoring the warning about "C\Users\supah\.m2\repository\com\blurengine\blur\0.2.1 SNAPSHOT\blur 0.2.1 SNAPSHOT.jar Library has Kotlin runtime bundled into it" because that library does need it shaded. But when I remove it from the blur jar, things work as expected in the ide. However, it shouldn't work in runtime because these classes are not present. The hacky way around this is to shade kotlin into my project instead of blur. But that's not reliable for other users
For some reason, this warning is now starting to become an error since I've updated something.. maybe intellij 2018.2?
I've noticed this error happens because of
.kotlin_module
files.
d
Can you please elaborate, what do you mean by "because of
.kotlin_module
files"?
s
Sorry, I meant to say .kotlin_metadata
but thank god i've found a report from a week ago \o/ https://youtrack.jetbrains.com/issue/KT-25709