在Android Studio遇到奇怪的ClassCastException,不确定如何解决。

huangapple go评论65阅读模式
英文:

Getting a weird ClassCastException from Android Studio and not sure how to fix it

问题

我遇到了以下异常:

java.lang.ClassCastException: 类 org.jetbrains.kotlin.psi.KtSuperTypeCallEntry 无法转换为类 org.jetbrains.kotlin.psi.KtCallExpression(org.jetbrains.kotlin.psi.KtSuperTypeCallEntry 和 org.jetbrains.kotlin.psi.KtCallExpression 在 'app' 的未命名模块的加载程序中)

我甚至不确定从哪里开始尝试识别问题。Google 似乎也没有任何结果。

英文:

I'm getting the following exception:

java.lang.ClassCastException: class org.jetbrains.kotlin.psi.KtSuperTypeCallEntry cannot be cast to class org.jetbrains.kotlin.psi.KtCallExpression (org.jetbrains.kotlin.psi.KtSuperTypeCallEntry and org.jetbrains.kotlin.psi.KtCallExpression are in unnamed module of loader 'app')

I'm not even sure where I would even start with this to even start trying to identify the problem.

Google does not seem to come up with anything either.

答案1

得分: 0

所以事实上,原来是我弄坏了它...经过大量的调试(我是说真的很多),结果发现我错误地初始化了一个视图模型,导致了这个错误。

修复了我弄坏的部分后,现在它按照预期工作了。

英文:

So it actually turns out I broke it... After a lot of tinkering (and I mean a lot), it turns out that I was incorrectly initialising a view model I had which turned into this erroneous error.

After fixing what I broke, it now works as expected.

huangapple
  • 本文由 发表于 2023年6月12日 18:46:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76455889.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定