AndreiBogdan
03/08/2024, 3:08 PMKMMViewModel
library but i'm facing an issue.
This is the ViewModel
open class BaseViewModel : KMMViewModel() {
protected val loadingOverlayMutable = MutableStateFlow<LoadingOverlayState>(viewModelScope, LoadingOverlayState.NotLoading)
@NativeCoroutinesState
val loadingOverlay = loadingOverlayMutable.asStateFlow()
protected fun setLoadingState(){
loadingOverlayMutable.value = LoadingOverlayState.Loading
}
protected fun setNotLoadingState(){
loadingOverlayMutable.value = LoadingOverlayState.NotLoading
}
}
and i'm getting the next error on the line where i instantaite the MutableStateFlow
BaseViewModel.kt:11:43 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
I have
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}
And also in Settings -> Build,Execution,Deployment -> Build Tools -> Gradle ... i have set Gradle JDK 17
I have no idea where the 11 and 1.8 are coming from. I'm guessing one's coming form his library, but the other ?!
I've spent HOURS now on this ... it's driving me crazy !
c.c. @Rick Clephas ? 😄Rick Clephas
03/08/2024, 6:12 PMLuka Mišković
03/08/2024, 8:02 PM@file:Suppress("INLINE_FROM_HIGHER_PLATFORM")
Not ideal though as it ends up being added to every ViewModelAndreiBogdan
03/10/2024, 8:57 AM