https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
n

Nikolay Kasyanov

11/26/2020, 3:54 PM
Hey folks, I have a feeling this must be a known issue. Here’s what happens: I have a KMP project and as soon as I have built something, IDEA (or Android Studio) starts using built artifacts (jar, class files) for code highlighting and navigation in the editor. For example, it starts falsely reporting some imports as unreachable because of classes being internal (although actual build works flawlessly, meaning internal is just fine). When you cmd-click the import, it shows a decompiled version of it instead of the source code. It definitely happens with types from
commonMain
when imported in files residing in
jvmTest
. Doing
./gradlew clean
solves the problem (editor navigation starts using source code, red highlighting of imports goes away) until next build. IDEA CE 2020.3 beta or 2020.2.4, Kotlin plugin 1.4.20.
💪🏽 1
c

Cicero

11/26/2020, 3:59 PM
Mine often feels kinda glitchy. I don’t understand half of the tasks registered in gradle
s

Sebastian Sellmair [JB]

11/26/2020, 4:24 PM
I expect issues like this getting better with IntelliJ 2020.3.1
Mine often feels kinda glitchy. I don’t understand half of the tasks registered in gradle
Just a few examples would be really helpful for me 🙂
@Nikolay Kasyanov If you're not building a Library, then maybe switching the affected Android modules from "pure android" to "MPP with only Android target" will mitigate your issue!
n

Nikolay Kasyanov

11/27/2020, 8:22 AM
@Sebastian Sellmair [JB] no pure Android modules, only KMM modules with Android target
s

Sebastian Sellmair [JB]

11/27/2020, 8:22 AM
Would you be available for a Google Meet session to show me the issue? 🙄
You can try with one of the latest 1.4.30 dev builds and see if my commit above fixed it for you!
n

Nikolay Kasyanov

11/27/2020, 8:29 AM
sure, I’ll try 1.4.30 dev builds. Re: a Google Meet session, not likely, I guess 1.4.30 will be out faster than our legal will approve that 😂
😁 1
Thanks for chiming in!
@Sebastian Sellmair [JB] btw, where do I get EAP builds of Kotlin plugin? I know the kotlin-eap Maven repo, no idea about the IDE plugin tho.
btw, just a random user review at https://plugins.jetbrains.com/plugin/6954-kotlin
s

Sebastian Sellmair [JB]

11/27/2020, 8:38 AM
IIRC: For the issue I linked is no update necessary for the IDE plugin! Regarding "where to get EAP ide plugin from": This is a complicated story, since https://blog.jetbrains.com/kotlin/2020/10/new-release-cadence-for-kotlin-and-the-intellij-kotlin-plugin/
So I am not sure if there is already a build for that for 203+ and if there are any, I do not know where to get them from 🙄
n

Nikolay Kasyanov

11/27/2020, 8:41 AM
I see, so I only need to use 1.4.30 Kotlin compiler and gradle plugin?
s

Sebastian Sellmair [JB]

11/27/2020, 8:41 AM
Yes!
Ooooooh wait...
Stupid me... That commit was for the IDE plugin only. I misremembered the issue.
n

Nikolay Kasyanov

11/27/2020, 9:06 AM
No worries, got it, thanks for your help