Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.2k views
in Technique[技术] by (71.8m points)

xml - ClassCast Exception Android Studio

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 cannot be cast to com.intellij.psi.xml.XmlFile

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...