gpt4 book ai didi

android-studio - 无法在 Android Studio 中编辑/查看布局文件

转载 作者:行者123 更新时间:2023-12-03 16:13:26 25 4
gpt4 key购买 nike

当我在 android studio 中双击打开一个 android 布局 *.xml 文件时,我在 Android studio 的事件日志中收到一个 AssertionError: null 并且布局编辑器没有打开。

这不会发生在每个项目中,并且开始发生在已经工作正常的项目中,这里是日志错误

null
java.lang.AssertionError
at com.android.tools.idea.rendering.MultiResourceRepository.setChildren(MultiResourceRepository.java:47)
at com.android.tools.idea.rendering.MultiResourceRepository.<init>(MultiResourceRepository.java:43)
at com.android.tools.idea.rendering.ModuleResourceRepository.<init>(ModuleResourceRepository.java:57)
at com.android.tools.idea.rendering.ModuleResourceRepository.create(ModuleResourceRepository.java:87)
at com.android.tools.idea.rendering.ProjectResources.create(ProjectResources.java:174)
at org.jetbrains.android.facet.AndroidFacet.getProjectResources(AndroidFacet.java:996)
at com.android.tools.idea.rendering.ProjectResources.get(ProjectResources.java:163)
at com.android.tools.idea.rendering.ProjectResources.get(ProjectResources.java:154)
at com.android.tools.idea.rendering.ModuleSetResourceRepository.create(ModuleSetResourceRepository.java:43)
at com.android.tools.idea.rendering.ProjectResources.create(ProjectResources.java:172)
at org.jetbrains.android.facet.AndroidFacet.getProjectResources(AndroidFacet.java:991)
at com.android.tools.idea.rendering.ProjectResources.get(ProjectResources.java:163)
at com.android.tools.idea.rendering.ProjectResources.get(ProjectResources.java:154)
at com.android.tools.idea.configurations.ConfigurationManager.create(ConfigurationManager.java:120)
at com.android.tools.idea.configurations.ConfigurationManager.getConfiguration(ConfigurationManager.java:99)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowForm.setFile(AndroidLayoutPreviewToolWindowForm.java:234)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:322)
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.UIUtil.invokeLaterIfNeeded(UIUtil.java:2003)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:266)
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.Alarm$Request$1.run(Alarm.java:289)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:347)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:672)
at java.awt.EventQueue.access$400(EventQueue.java:81)
at java.awt.EventQueue$2.run(EventQueue.java:633)
at java.awt.EventQueue$2.run(EventQueue.java:631)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:642)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:701)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:526)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:349)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

现在我无法在 Android Studio 中编辑/查看布局文件,有人知道如何解决这个问题吗?

最佳答案

只需从您的事件中删除此行:

tools:showIn="@layout/activity_splash"

关于android-studio - 无法在 Android Studio 中编辑/查看布局文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17412265/

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