【Android】在开发项目的时候,利用AndroidStudio开发工具,突然一直报错。
作者:程序员小冰,CSDN博客:http://blog.csdn.net/qq_21376985,
QQ986945193 公众号:程序员小冰
首先说明,虽然报错,但是并不影响开发使用。但是感觉很不爽。最后各种google搜索,找打了一个解决方法,那就是:
点击File -选择Invalidata Caches/Restart 重启后就没这个错了!
特意记录一下。
错误代码:
Invalid stub element type in index:
file: file:///home/linky/Android/sdk/sources/android-21/com/android/tools/layoutlib/create/ICreateInfo.java
psiElement: PsiMethod:getDelegateMethods
requiredClass: interface com.intellij.psi.PsiReferenceList
actualClass: class com.intellij.psi.impl.source.PsiMethodImpl
virtualFile: size:2711; stamp:0; modCount:1435547885666; fileType:JAVA; language:JAVA
document: size:2711; stamp:0; committed:true; saved:true
psiFile: size:2711; stamp:0; class:com.intellij.psi.impl.source.PsiJavaFileImpl; language:JAVA
stubInfo: created in getStubTree(); with backReference
indexing info: no data
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:115)
at com.intellij.psi.stubs.StubIndexImpl.reportStubPsiMismatch(StubIndexImpl.java:534)
at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:155)
at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:134)
at com.intellij.psi.impl.java.stubs.index.JavaSuperClassNameOccurenceIndex.get(JavaSuperClassNameOccurenceIndex.java:49)
at com.intellij.psi.impl.search.JavaDirectInheritorsSearcher$5.compute(JavaDirectInheritorsSearcher.java:107)
at com.intellij.psi.impl.search.JavaDirectInheritorsSearcher$5.compute(JavaDirectInheritorsSearcher.java:104)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:884)
at com.intellij.psi.impl.search.JavaDirectInheritorsSearcher.execute(JavaDirectInheritorsSearcher.java:104)
at com.intellij.psi.impl.search.JavaDirectInheritorsSearcher.execute(JavaDirectInheritorsSearcher.java:49)
at com.intellij.util.ExecutorsQuery.processResults(ExecutorsQuery.java:43)
at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:75)
at com.intellij.util.UniqueResultsQuery.process(UniqueResultsQuery.java:66)
at com.intellij.util.UniqueResultsQuery.forEach(UniqueResultsQuery.java:56)
at com.intellij.psi.search.searches.ClassInheritorsSearch.processInheritors(ClassInheritorsSearch.java:287)
at com.intellij.psi.search.searches.ClassInheritorsSearch.access$100(ClassInheritorsSearch.java:46)
at com.intellij.psi.search.searches.ClassInheritorsSearch$1.execute(ClassInheritorsSearch.java:75)
at com.intellij.psi.search.searches.ClassInheritorsSearch$1.execute(ClassInheritorsSearch.java:53)
at com.intellij.util.ExecutorsQuery.processResults(ExecutorsQuery.java:43)
at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:75)
at com.intellij.util.UniqueResultsQuery.process(UniqueResultsQuery.java:66)
at com.intellij.util.UniqueResultsQuery.forEach(UniqueResultsQuery.java:56)
at org.jetbrains.android.facet.AndroidFacet.fillMap(AndroidFacet.java:1022)
at org.jetbrains.android.facet.AndroidFacet.computeClassMap(AndroidFacet.java:968)
at org.jetbrains.android.facet.AndroidFacet.access$500(AndroidFacet.java:116)
at org.jetbrains.android.facet.AndroidFacet$4.compute(AndroidFacet.java:924)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:200)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
at org.jetbrains.android.facet.AndroidFacet.getClassMap(AndroidFacet.java:930)
at org.jetbrains.android.dom.AndroidDomExtender.getViewClassMap(AndroidDomExtender.java:425)
at org.jetbrains.android.dom.AndroidDomExtender.registerExtensionsForLayout(AndroidDomExtender.java:482)
at org.jetbrains.android.dom.AndroidDomExtender.processAttrsAndSubtags(AndroidDomExtender.java:624)
at org.jetbrains.android.dom.AndroidDomExtender.registerExtensions(AndroidDomExtender.java:830)
at org.jetbrains.android.dom.AndroidDomExtender.registerExtensions(AndroidDomExtender.java:78)
at com.intellij.util.xml.reflect.DomExtenderEP.extend(DomExtenderEP.java:62)
at com.intellij.util.xml.impl.DynamicGenericInfo.runDomExtenders(DynamicGenericInfo.java:164)
at com.intellij.util.xml.impl.DynamicGenericInfo.access$000(DynamicGenericInfo.java:49)
at com.intellij.util.xml.impl.DynamicGenericInfo$1.compute(DynamicGenericInfo.java:84)
at com.intellij.util.xml.impl.DynamicGenericInfo$1.compute(DynamicGenericInfo.java:81)
at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:112)
at com.intellij.util.xml.impl.DynamicGenericInfo.checkInitialized(DynamicGenericInfo.java:81)
at com.intellij.util.xml.impl.DynamicGenericInfo.getCustomNameChildrenDescription(DynamicGenericInfo.java:195)
at com.intellij.util.xml.impl.DomSemContributor$5.fun(DomSemContributor.java:180)
at com.intellij.util.xml.impl.DomSemContributor$5.fun(DomSemContributor.java:161)
at com.intellij.semantic.SemServiceImpl$6$1.fun(SemServiceImpl.java:129)
at com.intellij.semantic.SemServiceImpl$6$1.fun(SemServiceImpl.java:125)
at com.intellij.semantic.SemServiceImpl.createSemElements(SemServiceImpl.java:216)
at com.intellij.semantic.SemServiceImpl.getSemElements(SemServiceImpl.java:186)
at com.intellij.semantic.SemService.getSemElement(SemService.java:37)
at com.intellij.util.xml.impl.DomManagerImpl.getDomHandler(DomManagerImpl.java:389)
at com.intellij.util.xml.impl.DomManagerImpl.getDomElement(DomManagerImpl.java:366)
at org.jetbrains.android.dom.AndroidDomElementDescriptorProvider.getDomElementAndBaseClassQName(AndroidDomElementDescriptorProvider.java:98)
at org.jetbrains.android.dom.AndroidXmlReferenceProvider.computeBaseClass(AndroidXmlReferenceProvider.java:113)
at org.jetbrains.android.dom.AndroidXmlReferenceProvider.areReferencesProvidedByReferenceProvider(AndroidXmlReferenceProvider.java:99)
at org.jetbrains.android.dom.AndroidXmlExtension.createTagNameReference(AndroidXmlExtension.java:42)
at com.intellij.psi.impl.source.xml.TagNameReference.createTagNameReference(TagNameReference.java:192)
at com.intellij.psi.impl.source.xml.XmlTagImpl.getReferences(XmlTagImpl.java:171)
at com.intellij.psi.impl.SharedPsiElementImplUtil.addReferences(SharedPsiElementImplUtil.java:67)
at com.intellij.psi.impl.SharedPsiElementImplUtil.findReferenceAt(SharedPsiElementImplUtil.java:49)
at com.intellij.psi.impl.SharedPsiElementImplUtil.findReferenceAt(SharedPsiElementImplUtil.java:63)
at com.intellij.psi.impl.source.tree.CompositePsiElement.findReferenceAt(CompositePsiElement.java:118)
at com.intellij.psi.SingleRootFileViewProvider.findReferenceAt(SingleRootFileViewProvider.java:418)
at com.intellij.psi.SingleRootFileViewProvider.findReferenceAt(SingleRootFileViewProvider.java:390)
at com.intellij.psi.impl.source.PsiFileImpl.findReferenceAt(PsiFileImpl.java:616)
at com.intellij.codeInsight.TargetElementUtilBase.findReference(TargetElementUtilBase.java:117)
at com.intellij.codeInsight.TargetElementUtilBase.getReferenceOrReferencedElement(TargetElementUtilBase.java:319)
at com.intellij.codeInsight.TargetElementUtil.getReferenceOrReferencedElement(TargetElementUtil.java:95)
at com.intellij.codeInsight.TargetElementUtilBase.findTargetElement(TargetElementUtilBase.java:201)
at com.intellij.codeInsight.TargetElementUtil.findTargetElement(TargetElementUtil.java:60)
at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.doCollectInformation(IdentifierHighlighterPass.java:91)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:67)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:438)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1098)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:429)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:426)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:402)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask.exec(JobLauncherImpl.java:202)
at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:115)
at com.intellij.psi.stubs.StubIndexImpl.reportStubPsiMismatch(StubIndexImpl.java:534)
at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:155)
at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:134)
at com.intellij.psi.impl.java.stubs.index.JavaSuperClassNameOccurenceIndex.get(JavaSuperClassNameOccurenceIndex.java:49)
at com.intellij.psi.impl.search.JavaDirectInheritorsSearcher$5.compute(JavaDirectInheritorsSearcher.java:107)
at com.intellij.psi.impl.search.JavaDirectInheritorsSearcher$5.compute(JavaDirectInheritorsSearcher.java:104)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:884)
at com.intellij.psi.impl.search.JavaDirectInheritorsSearcher.execute(JavaDirectInheritorsSearcher.java:104)
at com.intellij.psi.impl.search.JavaDirectInheritorsSearcher.execute(JavaDirectInheritorsSearcher.java:49)
at com.intellij.util.ExecutorsQuery.processResults(ExecutorsQuery.java:43)
at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:75)
at com.intellij.util.UniqueResultsQuery.process(UniqueResultsQuery.java:66)
at com.intellij.util.UniqueResultsQuery.forEach(UniqueResultsQuery.java:56)
at com.intellij.psi.search.searches.ClassInheritorsSearch.processInheritors(ClassInheritorsSearch.java:287)
at com.intellij.psi.search.searches.ClassInheritorsSearch.access$100(ClassInheritorsSearch.java:46)
at com.intellij.psi.search.searches.ClassInheritorsSearch$1.execute(ClassInheritorsSearch.java:75)
at com.intellij.psi.search.searches.ClassInheritorsSearch$1.execute(ClassInheritorsSearch.java:53)
at com.intellij.util.ExecutorsQuery.processResults(ExecutorsQuery.java:43)
at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:75)
at com.intellij.util.UniqueResultsQuery.process(UniqueResultsQuery.java:66)
at com.intellij.util.UniqueResultsQuery.forEach(UniqueResultsQuery.java:56)
at org.jetbrains.android.facet.AndroidFacet.fillMap(AndroidFacet.java:1022)
at org.jetbrains.android.facet.AndroidFacet.computeClassMap(AndroidFacet.java:968)
at org.jetbrains.android.facet.AndroidFacet.access$500(AndroidFacet.java:116)
at org.jetbrains.android.facet.AndroidFacet$4.compute(AndroidFacet.java:924)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:200)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
at org.jetbrains.android.facet.AndroidFacet.getClassMap(AndroidFacet.java:930)
at org.jetbrains.android.dom.AndroidDomExtender.getViewClassMap(AndroidDomExtender.java:425)
at org.jetbrains.android.dom.AndroidDomExtender.registerExtensionsForLayout(AndroidDomExtender.java:482)
at org.jetbrains.android.dom.AndroidDomExtender.processAttrsAndSubtags(AndroidDomExtender.java:624)
at org.jetbrains.android.dom.AndroidDomExtender.registerExtensions(AndroidDomExtender.java:830)
at org.jetbrains.android.dom.AndroidDomExtender.registerExtensions(AndroidDomExtender.java:78)
at com.intellij.util.xml.reflect.DomExtenderEP.extend(DomExtenderEP.java:62)
at com.intellij.util.xml.impl.DynamicGenericInfo.runDomExtenders(DynamicGenericInfo.java:164)
at com.intellij.util.xml.impl.DynamicGenericInfo.access$000(DynamicGenericInfo.java:49)
at com.intellij.util.xml.impl.DynamicGenericInfo$1.compute(DynamicGenericInfo.java:84)
at com.intellij.util.xml.impl.DynamicGenericInfo$1.compute(DynamicGenericInfo.java:81)
at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:112)
at com.intellij.util.xml.impl.DynamicGenericInfo.checkInitialized(DynamicGenericInfo.java:81)
at com.intellij.util.xml.impl.DynamicGenericInfo.getCustomNameChildrenDescription(DynamicGenericInfo.java:195)
at com.intellij.util.xml.impl.DomSemContributor$5.fun(DomSemContributor.java:180)
at com.intellij.util.xml.impl.DomSemContributor$5.fun(DomSemContributor.java:161)
at com.intellij.semantic.SemServiceImpl$6$1.fun(SemServiceImpl.java:129)
at com.intellij.semantic.SemServiceImpl$6$1.fun(SemServiceImpl.java:125)
at com.intellij.semantic.SemServiceImpl.createSemElements(SemServiceImpl.java:216)
at com.intellij.semantic.SemServiceImpl.getSemElements(SemServiceImpl.java:186)
at com.intellij.semantic.SemService.getSemElement(SemService.java:37)
at com.intellij.util.xml.impl.DomManagerImpl.getDomHandler(DomManagerImpl.java:389)
at com.intellij.util.xml.impl.DomManagerImpl.getDomElement(DomManagerImpl.java:366)
at org.jetbrains.android.dom.AndroidDomElementDescriptorProvider.getDomElementAndBaseClassQName(AndroidDomElementDescriptorProvider.java:98)
at org.jetbrains.android.dom.AndroidXmlReferenceProvider.computeBaseClass(AndroidXmlReferenceProvider.java:113)
at org.jetbrains.android.dom.AndroidXmlReferenceProvider.areReferencesProvidedByReferenceProvider(AndroidXmlReferenceProvider.java:99)
at org.jetbrains.android.dom.AndroidXmlExtension.createTagNameReference(AndroidXmlExtension.java:42)
at com.intellij.psi.impl.source.xml.TagNameReference.createTagNameReference(TagNameReference.java:192)
at com.intellij.psi.impl.source.xml.XmlTagImpl.getReferences(XmlTagImpl.java:171)
at com.intellij.psi.impl.SharedPsiElementImplUtil.addReferences(SharedPsiElementImplUtil.java:67)
at com.intellij.psi.impl.SharedPsiElementImplUtil.findReferenceAt(SharedPsiElementImplUtil.java:49)
at com.intellij.psi.impl.SharedPsiElementImplUtil.findReferenceAt(SharedPsiElementImplUtil.java:63)
at com.intellij.psi.impl.source.tree.CompositePsiElement.findReferenceAt(CompositePsiElement.java:118)
at com.intellij.psi.SingleRootFileViewProvider.findReferenceAt(SingleRootFileViewProvider.java:418)
at com.intellij.psi.SingleRootFileViewProvider.findReferenceAt(SingleRootFileViewProvider.java:390)
at com.intellij.psi.impl.source.PsiFileImpl.findReferenceAt(PsiFileImpl.java:616)
at com.intellij.codeInsight.TargetElementUtilBase.findReference(TargetElementUtilBase.java:117)
at com.intellij.codeInsight.TargetElementUtilBase.getReferenceOrReferencedElement(TargetElementUtilBase.java:319)
at com.intellij.codeInsight.TargetElementUtil.getReferenceOrReferencedElement(TargetElementUtil.java:95)
at com.intellij.codeInsight.TargetElementUtilBase.findTargetElement(TargetElementUtilBase.java:201)
at com.intellij.codeInsight.TargetElementUtil.findTargetElement(TargetElementUtil.java:60)
at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.doCollectInformation(IdentifierHighlighterPass.java:91)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:67)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:438)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1098)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:429)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:426)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:402)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask.exec(JobLauncherImpl.java:202)
at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)
程序员小冰博客:http://blog.csdn.net/qq_21376985
技术交流QQ986945193
微博:http://weibo.com/mcxiaobing