Please start posting additional context inside the original question. This way itβs easier to follow and context is not lost when discussion starts.
βοΈ 1
r
Rob Elliot
04/07/2025, 5:49 PM
If you post a question and then work out how to resolve it, it's friendly to post how you resolved it for someone else searching for the solution to the same problem:
Sure, When I fixed it, I just go to sleep, so...., I will give the solution here,
Copy code
kotlin {
withSourcesJar()
explicitApi()
jvm {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
// β Put the arg here
freeCompilerArgs.add("-Xjvm-default=all")
}
}
mingwX64()
linuxX64()
linuxArm64()
macosX64()
macosArm64()
compilerOptions {
freeCompilerArgs.apply {
add("-Xexpect-actual-classes")
// Not here β cause this arg is only for jvm target
add("-Xjvm-default=all")
}
}
}