渲染问题在渲染过程中引发异常:com.android.ide.common.rendering.api.LayoutlibCallback [英] Rendering Problems Exception raised during rendering: com.android.ide.common.rendering.api.LayoutlibCallback

查看:24
本文介绍了渲染问题在渲染过程中引发异常:com.android.ide.common.rendering.api.LayoutlibCallback的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Android Studio 中创建项目时遇到问题.(版本 1.5.1)

我会逐步描述我的操作:

  • 打开 Android Studio.
  • 创建一个没有任何活动的新项目.
  • 做一个空白活动.

预览模式下可能有问题:

我收到这条消息:

渲染问题在渲染过程中出现异常:com.android.ide.common.rendering.api.LayoutlibCallback.getXmlFileParser(Ljava/lang/String;)Lorg/xmlpull/v1/XmlPullParser;

在堆栈跟踪中:

java.lang.NoSuchMethodError: com.android.ide.common.rendering.api.LayoutlibCallback.getXmlFileParser(Ljava/lang/String;)Lorg/xmlpull/v1/XmlPullParser;在 com.android.layoutlib.bridge.impl.ResourceHelper.getInternalComplexColor(ResourceHelper.java:146)在 com.android.layoutlib.bridge.impl.ResourceHelper.getColorStateList(ResourceHelper.java:231)在 android.content.res.BridgeTypedArray.getColorStateList(BridgeTypedArray.java:308)在 android.widget.TextView.(TextView.java:776)在 android.widget.TextView.(TextView.java:705)在 android.widget.TextView.(TextView.java:701)在 com.android.layoutlib.bridge.MockView.<init>(MockView.java:50)在 com.android.layoutlib.bridge.MockView.<init>(MockView.java:45)在 com.android.layoutlib.bridge.MockView.<init>(MockView.java:41)在 android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:163)在 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)在 android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)在 android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)在 android.view.LayoutInflater.rInflate(LayoutInflater.java:834)在 android.view.LayoutInflater.inflate(LayoutInflater.java:492)在 com.android.layoutlib.bridge.bars.CustomBar.(CustomBar.java:95)在 com.android.layoutlib.bridge.bars.StatusBar.(StatusBar.java:67)在 com.android.layoutlib.bridge.impl.Layout.createStatusBar(Layout.java:222)在 com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:144)在 com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:213)在 com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:426)在 com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)在 com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:510)在 com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:498)在 com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:888)在 com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:498)在 com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:72)在 com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:610)在 com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:607)在 com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:362)在 com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:607)在 com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:629)在 com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:480)在 com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)在 com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)在 com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)在 com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)在 com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)在 com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)在 com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)在 com.intellij.util.Alarm$Request$1.run(Alarm.java:351)在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)在 java.util.concurrent.FutureTask.run(FutureTask.java:266)在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)在 java.lang.Thread.run(Thread.java:745)

可能是什么问题?

解决方案

我在几分钟前更新后遇到了同样的问题,我为解决渲染问题所做的是将用于渲染布局的 android 版本从 Android Studio 改回到API 23:Android 6.0".

I encountered a problem when creating a project in Android Studio. (Version 1.5.1)

I describe my actions step-by-step:

  • Open Android Studio.
  • Create a new project without any activity.
  • Make a blank activity.

And there might be a problem in preview mode:

I get this message:

Rendering Problems Exception raised during rendering: com.android.ide.common.rendering.api.LayoutlibCallback.getXmlFileParser(Ljava/lang/String;)Lorg/xmlpull/v1/XmlPullParser;

In stack trace:

java.lang.NoSuchMethodError: com.android.ide.common.rendering.api.LayoutlibCallback.getXmlFileParser(Ljava/lang/String;)Lorg/xmlpull/v1/XmlPullParser;
    at com.android.layoutlib.bridge.impl.ResourceHelper.getInternalComplexColor(ResourceHelper.java:146)
    at com.android.layoutlib.bridge.impl.ResourceHelper.getColorStateList(ResourceHelper.java:231)
    at android.content.res.BridgeTypedArray.getColorStateList(BridgeTypedArray.java:308)
    at android.widget.TextView.<init>(TextView.java:776)
    at android.widget.TextView.<init>(TextView.java:705)
    at android.widget.TextView.<init>(TextView.java:701)
    at com.android.layoutlib.bridge.MockView.<init>(MockView.java:50)
    at com.android.layoutlib.bridge.MockView.<init>(MockView.java:45)
    at com.android.layoutlib.bridge.MockView.<init>(MockView.java:41)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:163)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
    at com.android.layoutlib.bridge.bars.CustomBar.<init>(CustomBar.java:95)
    at com.android.layoutlib.bridge.bars.StatusBar.<init>(StatusBar.java:67)
    at com.android.layoutlib.bridge.impl.Layout.createStatusBar(Layout.java:222)
    at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:144)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:213)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:426)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:510)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:498)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:888)
    at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:498)
    at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:72)
    at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:610)
    at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:607)
    at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:362)
    at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:607)
    at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:629)
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:480)
    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:351)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

What could be the problem?

解决方案

I had the same problem after some updates minutes ago, what I did to solve the rendering issue was to change the android version used to render layouts from Android Studio back to "API 23: Android 6.0".

这篇关于渲染问题在渲染过程中引发异常:com.android.ide.common.rendering.api.LayoutlibCallback的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆