icerockdev / moko-mvvm

Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development

Home Page:https://moko.icerock.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

logicgupta opened this issue · comments

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() })

@Alex009 PLEASE HAVE A LOOK

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

Updating the target to 11 worked for me.

Screenshot 2024-03-03 at 20 59 48

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.