我在运行我的项目时在 android studio 中收到 ClassCastException。谁能告诉我是什么导致了这个错误。
ClassCastException: com.intellij.psi.impl.source.PsiPlainTextFileImpl 无法转换为 com.intellij.psi.xml.XmlFile
谢谢。
最佳答案
终于解决了这个问题。这个问题帮助了我。 Android Studio ClassCastException When Attempting to Open A Layout XML File .我有一个 11MB 的 xml 值文件。这就是问题所在。删除后问题解决。
如果您想使用大型 XML 文件,请在 Android Studio 的 bin 文件夹中的 idea.properties 和 vmoptions 中添加以下代码。
**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
关于android - ClassCastException 安卓工作室,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34239231/