一個奇葩的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,
) { 。。。 }


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM