其他分享
首页 > 其他分享> > 一个奇葩的bug,关于Backend Internal error: Exception during IR lowering

一个奇葩的bug,关于Backend Internal error: Exception during IR lowering

作者:互联网

// viewmodel中定义两个数据
class LoginViewModel @Inject constructor() : BaseViewModel<LoginIntent>() {
    val height = MutableStateFlow(-1f)
    val weight = MutableStateFlow(-1f)
}

// UI中使用该数据做判定:
BaseLoginScreen(
	canNextClick = vm.weight.collectAsState().value!=-1f && vm.weight.collectAsState().value!=-1f,
) { 。。。 }
// 此时会报错,提示Backend Internal error: Exception during IR lowering,还有Runtime JAR files in the classpath should have the same version.

// 然而改成下面这种形式就对了:
val height = vm.weight.collectAsState().value
val weight = vm.weight.collectAsState().value
BaseLoginScreen(
	canNextClick = height!=-1f && weight!=-1f,
) { 。。。 }

标签:lowering,Exception,val,weight,IR,vm,value,collectAsState,1f
来源: https://www.cnblogs.com/lizhenxin/p/15926138.html