icerockdev / moko-mvvm

Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
994 stars 95 forks source link

Compile Error : JVM target 11 into bytecode that is being built with JVM target 1.8 #266

Open logicgupta opened 4 months ago

logicgupta commented 4 months ago

Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8

Getting Above error in compiling below line of code

val viewModel = getViewModel(key = "HomeScreen", factory = viewModelFactory { NewsViewModel() })

logicgupta commented 4 months ago

@Alex009 PLEASE HAVE A LOOK

ernestkamara commented 3 months ago

I also ran into this issue when running my Compose Multiplatform Android app.

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

ernestkamara commented 3 months ago

Updating the target to 11 worked for me.

Screenshot 2024-03-03 at 20 59 48
Fifteen15Studios commented 3 months ago

This works when building for Android, but not when building for desktop. I tried changing the target everywhere I can, and still get this error when building for desktop.