Android Studio布局编辑器中引发异常

时间:2016-03-26 18:09:20

标签: android android-studio

尝试在最新的Android Studio中编辑布局时,我遇到以下异常。我仍然可以编辑文本,但设计选项卡不起作用。有没有解决这个问题或者我做错了什么?

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)

1 个答案:

答案 0 :(得分:2)

如果您安装了N SDK,Android Studio似乎想要使用N预览渲染器。使用下拉列表选择稳定版本。