在Android Studio中切换到设计视图时已经处理了java.lang.AssertionError

时间:2013-11-19 11:14:52

标签: android android-studio assertions

在Android Studio中切换到设计视图时出现以下错误,活动中没有任何变化,以前它曾经工作过:

java.lang.AssertionError: Already disposed
    at com.intellij.openapi.components.impl.ComponentManagerImpl.getPicoContainer(ComponentManagerImpl.java:263)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.getPicoContainer(ComponentManagerImpl.java:55)
    at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:40)
    at com.intellij.openapi.roots.impl.DirectoryIndex.getInstance(DirectoryIndex.java:31)
    at org.jetbrains.android.dom.AndroidXmlExtension.isAvailable(AndroidXmlExtension.java:52)
    at com.intellij.xml.XmlExtension.getExtension(XmlExtension.java:48)
    at com.intellij.xml.XmlExtension.getExtensionByElement(XmlExtension.java:59)
    at com.intellij.psi.impl.source.xml.XmlTagImpl.computeNamespaceMap(XmlTagImpl.java:893)
    at com.intellij.psi.impl.source.xml.XmlTagImpl.initNamespaceMaps(XmlTagImpl.java:857)
    at com.intellij.psi.impl.source.xml.XmlTagImpl.getAttributeValue(XmlTagImpl.java:631)
    at com.android.tools.idea.rendering.PsiResourceItem$1.getDefaultIndex(PsiResourceItem.java:160)
    at com.android.ide.common.rendering.api.ArrayResourceValue.getValue(ArrayResourceValue.java:95)
    at com.android.ide.common.resources.ResourceResolver.resolveResValue(ResourceResolver.java:272)
    at com.android.ide.common.resources.ResourceResolver.resolveResValue(ResourceResolver.java:263)
    at com.android.ide.common.resources.ResourceResolver.resolveValue(ResourceResolver.java:258)
    at com.android.layoutlib.bridge.android.BridgeContext.obtainStyledAttributes(BridgeContext.java:705)
    at android.widget.AbsSpinner.<init>(AbsSpinner.java:71)
    at android.widget.Spinner.<init>(Spinner.java:165)
    at android.widget.Spinner.<init>(Spinner.java:144)
    at android.widget.Spinner.<init>(Spinner.java:128)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at android.view.LayoutInflater.createView(LayoutInflater.java:594)
    at android.view.BridgeInflater.onCreateView(BridgeInflater.java:86)
    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:131)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:758)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:758)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:373)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:399)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:336)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:332)
    at com.android.tools.idea.rendering.RenderService$3.compute(RenderService.java:542)
    at com.android.tools.idea.rendering.RenderService$3.compute(RenderService.java:535)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:934)
    at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:535)
    at com.android.tools.idea.rendering.RenderService.render(RenderService.java:577)
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$7$2.compute(AndroidDesignerEditorPanel.java:501)
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$7$2.compute(AndroidDesignerEditorPanel.java:494)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:945)
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$7.run(AndroidDesignerEditorPanel.java:494)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
    at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:297)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)

有关此的任何线索吗?

1 个答案:

答案 0 :(得分:17)

尝试选择File -> Invalidate Caches / Restart

我在Android Studio中遇到了类似的问题,并找到了发布解决方案的this博客。

我已发布此答案,希望它能帮助其他人搜索此错误。 我的Android Studio版本是0.6.1预览版