膨胀类错误:Android

时间:2016-09-18 07:43:26

标签: android android-xml android-seekbar

我在android的xml文件中遇到问题。这是我的第二个应用程序,因此不太清楚错误出现的原因。这是截图: enter image description here

我得到的错误是:

java.lang.NoSuchMethodError: android.graphics.drawable.VectorDrawable_Delegate.nCreateTreeFromCopy(JJ)J
at android.graphics.drawable.VectorDrawable.nCreateTreeFromCopy(VectorDrawable.java)
at android.graphics.drawable.VectorDrawable.access$400(VectorDrawable.java:204)
at android.graphics.drawable.VectorDrawable$VectorDrawableState.createNativeTreeFromCopy(VectorDrawable.java:837)
at android.graphics.drawable.VectorDrawable$VectorDrawableState.<init>(VectorDrawable.java:812)
at android.graphics.drawable.VectorDrawable.mutate(VectorDrawable.java:268)
at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:817)
at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:329)
at android.graphics.drawable.AnimatedStateListDrawable$AnimatedStateListState.addStateSet(AnimatedStateListDrawable.java:602)
at android.graphics.drawable.AnimatedStateListDrawable.parseItem(AnimatedStateListDrawable.java:525)
at android.graphics.drawable.AnimatedStateListDrawable.inflateChildElements(AnimatedStateListDrawable.java:453)
at android.graphics.drawable.AnimatedStateListDrawable.inflate(AnimatedStateListDrawable.java:385)
at android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1224)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1197)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:315)
at android.content.res.BridgeTypedArray.getDrawable(BridgeTypedArray.java:681)
at android.widget.AbsSeekBar.<init>(AbsSeekBar.java:99)
at android.widget.SeekBar.<init>(SeekBar.java:85)
at android.widget.SeekBar.<init>(SeekBar.java:81)
at android.widget.SeekBar.<init>(SeekBar.java:77)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.BridgeInflater.onCreateView(BridgeInflater.java:107)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:717)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:785)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:149)
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.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:317)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:520)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:508)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:967)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:508)
at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:75)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:620)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:617)
at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:371)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:617)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:639)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:654)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:82)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:596)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:591)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
at com.intellij.util.ui.update.MergingUpdateQueue$3.run(MergingUpdateQueue.java:271)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:286)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:244)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:234)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:352)
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)

不确定是什么问题,我对stackoverflow上已经提供的所有解决方案进行了三重处理,其中说9版补丁图像的某些问题没有正确更新,但没有任何帮助。注意:此错误仅在我在xml中添加搜索栏控件时出现。

由于

Ashutosh说

1 个答案:

答案 0 :(得分:1)

这似乎是一个问题,它由谷歌HERE处理:

其他一些人正面临同样的问题,修复方法总是将预览API从24更改为23(或任何其他版本)。

您可能需要下载以前版本的SDK .. 您无需更改build.gradle ...只需下载SDK,Android Studio即可让您更改SDK在布局预览中

enter image description here