英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论