Tag Archives: Exception during IR lowering

[Solved] Backend Internal error: Exception during IR lowering

// Define two datas in viewmodel
class LoginViewModel @Inject constructor() : BaseViewModel<LoginIntent>() {
    val height = MutableStateFlow(-1f)
    val weight = MutableStateFlow(-1f)
}

// The data is used in the UI to make the determination.
BaseLoginScreen(
	canNextClick = vm.weight.collectAsState().value!=-1f && vm.weight.collectAsState().value!=-1f,
) { 。。。 }
// it will report error: Backend Internal error: Exception during IR lowering, and Runtime JAR files in the classpath should have the same version.

// Solution:
val height = vm.weight.collectAsState().value
val weight = vm.weight.collectAsState().value
BaseLoginScreen(
	canNextClick = height!=-1f && weight!=-1f,
) { ... }