ClassCast 异常 Android Studio [英] ClassCast Exception Android Studio

查看:27
本文介绍了ClassCast 异常 Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行我的项目时在 android studio 中收到 ClassCastException.谁能告诉我是什么导致了这个错误.

I am getting a ClassCastException in android studio while running my project. Can anyone tell me what is causing this error.

ClassCastException: com.intellij.psi.impl.source.PsiPlainTextFileImpl 不能转换为 com.intellij.psi.xml.XmlFile

ClassCastException: com.intellij.psi.impl.source.PsiPlainTextFileImpl cannot be cast to com.intellij.psi.xml.XmlFile

谢谢.

推荐答案

终于解决了这个问题.这个问题帮助了我.Android Studio ClassCastException 尝试打开布局 XML 时文件.我有一个 11MB 的 xml 文件.那就是问题所在.删除之后问题就解决了.

Sovled this atlast. This Question helped me. Android Studio ClassCastException When Attempting to Open A Layout XML File . I had a 11MB xml file in values. That was the problem. After deleting that, the problem was solved.

如果您想使用大型 XML 文件,请在 Android Studio 的 bin 文件夹中的 idea.properties 和 vmoptions 中添加以下代码.

And if you want to use a large XML file add the below code in idea.properties and vmoptions in the bin folder of Android Studio.

**Add in idea.properties**
 #-------------------------------------------------------------    --------
# Maximum file size (kilobytes) IDE     should provide code assistance for.
# The larger file is the slower its.    editor works and higher overall system     memory requirements are
# if code assistance is enabled.     Remove this property or set to very.    large number if you need
# code assistance for any files     available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=999999


**Add in vmoptions**


-Didea.max.intellisense.filesize=999999     # <--- new line

Reference: https://stackoverflow.com/questions/23057988/file-size-exceeds-configured-limit-2560000-code-insightfeatures-not-availabl

这篇关于ClassCast 异常 Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆