Hello,
I'm using Mockative (
https://github.com/mockative/mockative), which relies on KSP, to mock in a multiplatform lib's unit tests, but I'm getting the following error when running them:
Cannot inline bytecode built with JVM target 17 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
in lines such as
@Mock
val someService = mock(classOf<SomeService>())
How can I specify this '-jvm-target'?
Currently using kotlin multiplatform 1.9.0 and ksp 1.9.0-1.0.13 plugins. The kmp module is configured with:
kotlin {
targetHierarchy.default()
androidTarget {
compilations.all {
kotlinOptions {
languageVersion = "1.6"
apiVersion = "1.6"
jvmTarget = "1.8"
}
}
}
iosX64()
iosArm64()
iosSimulatorArm64()
...
}
...
android {
...
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
Sorry if this is not at all related to ksp.