I have a pure java project, and it includes a jvm.jar that export by a KMP project, when I use some classes defined in the jvm.jar, the project will crash, the error message is “java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics” ...
I guess there maybe need kotlin runtime, so I add this in KMP project’s gradle:
tasks._withType_<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
* *kotlinOptions {
* *includeRuntime = true
noStdlib = false
}}
but it not work,
Is there anyone who could give some advice?
e
edrd
03/07/2021, 1:21 PM
How are you including the
jvm.jar
in the Java project? Can you show the code?
y
Yaroslav Chernyshev [JB]
03/07/2021, 4:44 PM
Hi @Lei Wu! There are 2 relevant tickets with your question KT-44361 and KT-44360:
includeRuntime
,
noStdlib
and
noReflect
options will be deprecated since 1.5.
l
Lei Wu
03/07/2021, 5:34 PM
@edrd Just put the jvm.jar in the libs folder, and like this :dependencies {
implementation files(‘libs/jvm.jar’)
}