I'm trying to debug a multiplatform library using ...
# intellij
z
I'm trying to debug a multiplatform library using IDEA and inspect a local variable but it says this error message that I've never seen before during debugging
Copy code
org.jetbrains.kotlin.analysis.api.components.KaCodeCompilationException : org.jetbrains.kotlin.utils.exceptions.KotlinIllegalStateExceptionWithAttachments: Cannot compile a common source without a JVM counterpart
Has anyone else encountered this error? What should I do?
b
Looks like a bug to me
y
Can you please share your module structure? In particular, do you have an implementing JVM module for your
common
module?
z
@yan I'm unable to share code until later this afternoon. I do have a JVM module configured though
d
I found this thread and I am experiencing the same issue: org.jetbrains.kotlin.analysis.api.components.KaCodeCompilationException : org.jetbrains.kotlin.utils.exceptions.KotlinIllegalStateExceptionWithAttachments: Cannot compile a common source without a JVM counterpart The project is open source and it is this one: https://github.com/Collektive/collektive
Breakpoint evaluation also fails
b
d
But I'm using Kotlin 2.1.21... the fix should be in. Or is Idea using a different Kotlin version? If so, how can i force it to use Kotlin 2.1.21?
п
Hi. Found this thread via google. I've faced with the same issue recently and it got me really stuck. The bug reproduced on a specific project in Android Studio both 2025.1.2 Canary 4 and 2025.1.1 Patch 1. Other projects with the same structure (KMP, few build targets) worked fine. Disabling K2 complier on IDE level has helped and code evaluation on breakpoints became available.
151 Views