ClassCast异常Android Studio [英] ClassCast Exception 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
谢谢.
推荐答案
终于解决了这个问题.这个问题帮助了我. 尝试打开布局XML时的Android Studio ClassCastException文件.我在值中有一个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屋!