gpt4 book ai didi

android - 在Android Studio切换到设计 View 时已经处理java.lang.AssertionError

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:54:23 24 4
gpt4 key购买 nike

在 Android Studio 中切换到 Design View 时出现以下错误,activity 中没有任何变化并且以前可以工作:

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)

有什么线索吗?

最佳答案

尝试选择 File -> Invalidate Caches/Restart

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

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

更新:在 IntelliJ 2021.3 中,一项名为Repair IDE 的新功能已被 introduced可以从 File -> Repair IDE 调用,或者通过 Cmd + Shift + A (Mac)Ctrl + Shift + A (Windows )。基于 IntelliJ 2021.3 构建的 Android Studio Dolphin 率先具备此功能。

关于android - 在Android Studio切换到设计 View 时已经处理java.lang.AssertionError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20070000/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com