today I migrated my KMM project to use compose-vie...
# koin
a
today I migrated my KMM project to use compose-viewmodel and started to use
koinViewModel<AccountsVM>()
but getting below error at every usages
Copy code
Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option.
It seems that
koinViewModel
is built using Java 11 while I am targeting my android setup to 1.8 as below
Copy code
kotlin {
    androidTarget {
        @OptIn(ExperimentalKotlinGradlePluginApi::class)
        compilerOptions {
            jvmTarget.set(JvmTarget.JVM_1_8)
        }
    }
}

android {
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
}
Is there something that I am missing? Or is koin-compose-viewmodel is not meant to use with jvm 1.8?
a
what version do you use?
a
koin-bom = "4.0.0-RC2"
a
compose needs java 11 I think
a
But android is for java 1.8 right? So everywhere it gets mentioned to use below config
Copy code
compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
a
it depends.
a
compose needs java 11 I think
is there any doc for this? I think I am getting it wrong
a
I'm still checking
a
You JDK to build the project can run on any java version(> 13) but your bytecode that actually runs on device should target
VERSION_1_8
o/w common code which is compiled with later version of Java will not be able to run on Android
a
yeah, there is glitch in the gradle config. Just checking if this is a constraint or an issue
ok, got some VERSION_11 traces around. Removed it 👍
thank you color 1
thanks for the feedback
a
Actually it should be explicit
VERSION_1_8
o/w I think it fallbacks to you installed jdk version which is running the Gradle(or do you have some other way to set it?)
a
I need to specify it everywhere
on the library side, ensuring we keep everything java8
a
I think yes..
a
it' has been updated 👍
thank you color 1
a
Also update means new release has been published or PR has been merged?
a
yes