Programing

렌더링 중 예외 발생 : 이진 XML 파일 줄 # -1 : 오류 팽창 클래스

crosscheck 2020. 11. 27. 07:47
반응형

렌더링 중 예외 발생 : 이진 XML 파일 줄 # -1 : 오류 팽창 클래스


문제의 이미지

레이아웃에 확인란을 포함하려고했는데 드래그 앤 드롭 후이 오류가 발생합니다.

렌더링 중 예외 발생 : 이진 XML 파일 줄 # -1 : error inflating class<unknown>.

xml 파일 :

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.nidhigupta.shopping2.MainActivity">

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello World!"
    android:id="@+id/textView" />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New CheckBox"
    android:id="@+id/checkBox"
    android:layout_below="@+id/textView"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true" />

</RelativeLayout>

단계별 솔루션을 제공하십시오.

세부 사항 링크는 말한다 :

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.CompoundButton.<init>(CompoundButton.java:89)
at android.widget.CheckBox.<init>(CheckBox.java:70)
at android.widget.CheckBox.<init>(CheckBox.java:66)
at android.widget.CheckBox.<init>(CheckBox.java:62)
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 com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$7.run(AndroidDesignerEditorPanel.java:519)
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)

2016 년 9 월 업데이트

Android 스튜디오 v2.2에서 더 이상 문제를 재현 할 수 없습니다. Android Studio를 업데이트하면 문제가 더 이상 재현되지 않습니다.

2016 년 8 월 업데이트

Android Studio v2.1.3에서 여전히 문제가 발생합니다.

원래 답변

이것이 문제인 것 같으며 여기 에서 Google에서 처리 중입니다 .

다른 사람들도 같은 문제에 직면하고 있으며 수정은 항상 미리보기 API를 24에서 23 (또는 다른 버전)으로 변경하는 것입니다.

You may need to download a previous version of SDK.. You don't need to change your build.gradle... Just download the SDK and Android Studio will allow you to change the SDK in Layout Preview

여기에 이미지 설명 입력


Rendering Problem Related Issue is Resolved Check out the Answer here that says

android studio pick Automatically Pick Best by default

so you have to select previous one API 23 manually.


I have similar issue and resolve it by manage pixel sizes of drawables and width-height of controls in xml file. Please do not add any controls in xml file which is not used in class file.


I had a similar problem. I resolved it by decreasing the size of the images in the drawable folder.


I have selected the previous version as suggested but still did not see the previous image.

What I did was this:

  1. In the list of versions selected the " previous version " and "Preview Androids Versions " .

  2. Once the screens appear earlier versions of android I click on one of the previous and drag on the image layout that does not images.

To me it worked well , I hope and serve them . We're reading .


I was using API 22, though API 25 was available on my System.

Moving the problematic tab between different split views did the trick in a second.


I've had this exception before and what worked for me was File -> Invalidate Caches/Restart.

You may try that, but you should know that all of the Local History will be deleted.

Edit: Downgrading from API 24 to API 23 also works.


You can try to change the AppTheme.

참고 URL : https://stackoverflow.com/questions/38544129/exception-raised-during-renderingbinary-xml-file-line-1error-inflating-class

반응형