IntelliJ Android项目未呈现设计布局

时间:2019-07-27 23:51:59

标签: android intellij-idea

设计视图不存在,当我检查错误时,它说了一些有关渲染类加载器的内容

java.lang.AssertionError
    at com.android.tools.idea.rendering.ClassConverter.rewriteClass(ClassConverter.java:81)
    at com.android.tools.idea.rendering.ClassConverter.rewriteClass(ClassConverter.java:72)
    at com.android.tools.idea.rendering.RenderClassLoader.convertClass(RenderClassLoader.java:184)
    at com.android.tools.idea.rendering.RenderClassLoader.loadClass(RenderClassLoader.java:168)
    at com.android.tools.idea.rendering.RenderClassLoader.loadClassFile(RenderClassLoader.java:149)
    at org.jetbrains.android.uipreview.ModuleClassLoader.loadClassFile(ModuleClassLoader.java:301)
    at org.jetbrains.android.uipreview.ModuleClassLoader.loadClassFromModuleOrDependency(ModuleClassLoader.java:239)
    at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:177)
    at com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:61)
    at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:124)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at org.jetbrains.android.uipreview.ModuleClassLoader.loadClass(ModuleClassLoader.java:224)
    at org.jetbrains.android.uipreview.ViewLoader.loadAndParseRClass(ViewLoader.java:536)
    at org.jetbrains.android.uipreview.ViewLoader.loadAndParseRClassSilently(ViewLoader.java:509)
    at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadAndParseRClass(LayoutlibCallbackImpl.java:849)
    at com.android.tools.idea.rendering.RenderTask.<init>(RenderTask.java:174)
    at com.android.tools.idea.rendering.RenderService$RenderTaskBuilder.build(RenderService.java:590)
    at com.android.tools.idea.uibuilder.scene.LayoutlibSceneManager.inflate(LayoutlibSceneManager.java:830)
    at com.android.tools.idea.uibuilder.scene.LayoutlibSceneManager.updateModel(LayoutlibSceneManager.java:904)
    at com.android.tools.idea.uibuilder.scene.LayoutlibSceneManager$2.lambda$run$0(LayoutlibSceneManager.java:625)
    at com.intellij.openapi.project.DumbServiceImpl.doRun(DumbServiceImpl.java:389)
    at com.intellij.openapi.project.DumbServiceImpl.updateFinished(DumbServiceImpl.java:381)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:82)
    at com.intellij.openapi.application.TransactionGuardImpl.lambda$pollQueueLater$0(TransactionGuardImpl.java:67)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:433)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:416)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:399)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:873)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:822)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:461)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:460)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

enter image description here

2 个答案:

答案 0 :(得分:2)

YouTrack上存在一个已知问题:https://youtrack.jetbrains.com/issue/IDEA-215785。它应该在最近的更新中修复。

答案 1 :(得分:0)

您可以做两件事:

  1. 检查项目中是否存在一些编译问题。检查后,进行项目构建。
  2. 运行Invalidate cache/restart