Calligraphy icon indicating copy to clipboard operation
Calligraphy copied to clipboard

android.view.InflateException: Binary XML file line #0: Error inflating class android.widget.EditText

Open iad24 opened this issue 7 years ago • 56 comments

It happens to ZenFone 2 device, Android 5.0 Im using this lib version 2.3.0

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx.yyy/com.myapp.modules.login.views.LoginActivity}: android.view.InflateException: Binary XML file line #0: Error inflating class android.widget.EditText at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2326) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5264) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:900) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:695) Caused by android.view.InflateException: Binary XML file line #0: Error inflating class android.widget.EditText at android.view.LayoutInflater.createView(LayoutInflater.java:633) at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.onCreateView(CalligraphyLayoutInflater.java:164) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.onCreateView(CalligraphyLayoutInflater.java:148) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at android.view.LayoutInflater.inflate(LayoutInflater.java:365)

Full stack trace is here: stacktrace.txt

Layout xml file of Login activity: activity_login.txt

iad24 avatar Oct 12 '17 07:10 iad24

I`m having the same issue..

cotfas avatar Nov 01 '17 13:11 cotfas

It seems this library does not work well with TextInputLayout

<android.support.design.widget.TextInputLayout
        android:id="@+id/usernameLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:theme="@style/TextAppearance.TextInputLayout.Login"
        android:layout_marginBottom="@dimen/default_margin_3"
        android:layout_marginStart="@dimen/default_margin_3"
        android:layout_marginEnd="@dimen/default_margin_3"
        android:gravity="bottom"

        >

        <EditText
            android:id="@+id/usernameEditTxt"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="@dimen/default_margin_3"
            android:textSize="16sp"
            android:singleLine="true"
            android:textColor="@color/colorGrey3"
            android:hint="Username"
            android:text="[email protected]"
            android:inputType="textEmailAddress"
            />
    </android.support.design.widget.TextInputLayout>

style.xml

<style name="TextAppearance.TextInputLayout.Login">
        <item name="fontPath">fonts/font.ttf</item>
        <item name="android:textColorHint">@color/colorAccent2</item>
        <item name="colorAccent">@color/colorGrey4</item>
        <item name="colorControlNormal">@color/colorGrey6</item>
        <item name="colorControlActivated">@color/colorAccent2</item>
        <item name="android:textSize">16sp</item>
    </style>

If I remove the android:theme in TextInputLayout, the exception is gone.

iad24 avatar Nov 01 '17 14:11 iad24

Same issue but with Buttons.

android.view.InflateException: Binary XML file line #0: Error inflating class Button

Device: LG G3 Operating System: 4.4.2

`

Caused by android.content.res.Resources$NotFoundException

  | android.content.res.Resources.loadDrawable (Resources.java:2136)   | android.support.v7.app.AppCompatDelegateImplV9.onCreateView (Unknown Source)   | uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$WrapperFactory2.onCreateView (Unknown Source)   | android.view.LayoutInflater$FactoryMerger.onCreateView (LayoutInflater.java:172)   | android.view.LayoutInflater.inflate (LayoutInflater.java:492)   | uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate (Unknown Source)   | android.view.LayoutInflater.inflate (LayoutInflater.java:397)   | com.buildone.delivery.features.profile.DriverProfileFragment.onCreateView (Unknown Source)   | android.support.v4.app.Fragment.performCreateView (Unknown Source)   | dalvik.system.NativeStart.main (NativeStart.java)

Caused by org.xmlpull.v1.XmlPullParserException

  | android.graphics.drawable.Drawable.createFromXmlInner (Drawable.java:933)   | android.support.v7.app.AppCompatDelegateImplV9.onCreateView (Unknown Source)   | uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$WrapperFactory2.onCreateView (Unknown Source)   | android.view.LayoutInflater$FactoryMerger.onCreateView (LayoutInflater.java:172)   | android.view.LayoutInflater.inflate (LayoutInflater.java:492)   | uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate (Unknown Source)   | android.view.LayoutInflater.inflate (LayoutInflater.java:397)   | com.buildone.delivery.features.profile.DriverProfileFragment.onCreateView (Unknown Source)   | android.support.v4.app.Fragment.performCreateView (Unknown Source)   | dalvik.system.NativeStart.main (NativeStart.java)

EDIT: My problem was using vector drawables in android buttons. Not related to calligraphy.

xPryds avatar Nov 18 '17 17:11 xPryds

Same issue with LG H810 Android 5.1

swat-cat avatar Dec 26 '17 12:12 swat-cat

Same problem with LG k240h 6.0

enriqkeg avatar Jan 08 '18 09:01 enriqkeg

I had the same bug, and cause by the attribute "BackgroundTint" in the Floating button view

CaviaTheGuineaPig avatar Jan 09 '18 23:01 CaviaTheGuineaPig

I have same issue in SAMSUNG GLAXAY J5 .

Tizhoodh82 avatar Jan 12 '18 13:01 Tizhoodh82

same issue in android studio 3.0 OS 4.4.2

uliluck avatar Jan 18 '18 13:01 uliluck

/AndroidRuntime: FATAL EXCEPTION: main Process: com.taggroup.www.darzeeco, PID: 3664 android.view.InflateException: Binary XML file line #0: Error inflating class ImageButton at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:714) at android.view.LayoutInflater.rInflate(LayoutInflater.java:756) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at android.view.LayoutInflater.inflate(LayoutInflater.java:353) at com.taggroup.www.darzeeco.CustomerAct.CartAdapter.onCreateViewHolder(CartAdapter.java:42) at com.taggroup.www.darzeeco.CustomerAct.CartAdapter.onCreateViewHolder(CartAdapter.java:27) at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6519) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5706) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5589) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5585) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2231) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1558) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1518) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:610) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3719) at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3135) at android.view.View.measure(View.java:16497) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:719) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:455) at android.view.View.measure(View.java:16497) at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1226) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at android.widget.ScrollView.onMeasure(ScrollView.java:326) at android.view.View.measure(View.java:16497) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139) at android.view.View.measure(View.java:16497) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) at android.view.View.measure(View.java:16497) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at android.view.View.measure(View.java:16497) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) at android.view.View.measure(View.java:16497) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2291) at android.view.View.measure(View.java:16497) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1916) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1113) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1295) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) at android

Sufi313 avatar Feb 01 '18 18:02 Sufi313

Hi! guys i have this error when i run application in kitkat i know multidex and i enabled but error show

Sufi313 avatar Feb 01 '18 18:02 Sufi313

For Android Studio 3.0.1

I have got the same issue and I have resolved finally Opening the gradle.properties and added following line:

android.enableAapt2=false

sshahidaslamm avatar Feb 13 '18 07:02 sshahidaslamm

Same issue: Solved. My image files were in the "drawable-v24" folder. I copied them to the "drawable" folder too. Problem solved.

techview51 avatar Mar 05 '18 18:03 techview51

@techview51 you saved my life thank you!!!!

ariel179 avatar Mar 07 '18 15:03 ariel179

@sshahidaslamm your solution solved my problem!

RofaeilAshaiaa avatar Mar 12 '18 01:03 RofaeilAshaiaa

@ariel179 You are welcome.

techview51 avatar Mar 14 '18 13:03 techview51

Same problem here but with Fragment.

AdrianoJunior avatar Mar 24 '18 23:03 AdrianoJunior

@techview51 Copied and fixed, thank you so much!

ghost avatar Mar 29 '18 00:03 ghost

@techview51 Thank you so much !

samk17cmutpm avatar Mar 29 '18 09:03 samk17cmutpm

@techview51 thanks a ton mate 🗡

ghost avatar Mar 29 '18 22:03 ghost

@TBaulos , @samk17cmutpm , @UnselfconsciousLux : You are welcome.

techview51 avatar Apr 11 '18 09:04 techview51

Also had the same ussue, I did what @techview51 said and it worked.

georgetsiga avatar Apr 19 '18 09:04 georgetsiga

@techview51 thanks for solutions... very simple!

allexiusw avatar May 01 '18 17:05 allexiusw

me: FATAL EXCEPTION: main Process: com.example.ennie.miniproject, PID: 15398 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ennie.miniproject/com.example.ennie.miniproject.LoginActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class Button at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2572) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2654) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1488) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5728) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679) Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class Button at android.view.LayoutInflater.inflate(LayoutInflater.java:539) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:286) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.example.ennie.miniproject.LoginActivity.onCreate(LoginActivity.java:26) at android.app.Activity.performCreate(Activity.java:6371) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2654)  at android.app.ActivityThread.-wrap11(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1488)  at android.os.Handler.dispatchMessage(Handler.java:111)  at android.os.Looper.loop(Looper.java:207)  at android.app.ActivityThread.main(ActivityThread.java:5728)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)  Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class Button at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:782) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:286)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)  at com.example.ennie.miniproject.LoginActivity.onCreate(LoginActivity.java:26)  at android.app.Activity.performCreate(Activity.java:6371)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2654)  at android.app.ActivityThread.-wrap11(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1488)  at android.os.Handler.dispatchMessage(Handler.java:111)  at android.os.Looper.loop(Looper.java:207)  at android.app.ActivityThread.main(ActivityThread.java:5728)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)  Caused by: android.content.res.Resources$NotFoundException: Resource "com.example.ennie.miniproject:drawable/shape" (7f070077) is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f070077 a=-1 r=0x7f070077} at android.content.res.Resources.loadDrawableForCookie(Resources.java:2899) at android.content.res.Resources.loadDrawable(Resources.java:2821) at android.content.res.TypedArray.getDrawable(TypedArray.java:870) at android.view.View.(View.java:4001) at android.widget.TextView.(TextView.java:700) at android.widget.Button.(Button.java:109) at android.widget.Button.(Button.java:105) at android.support.v7.widget.AppCompatButton.(AppCompatButton.java:65) at android.support.v7.widget.AppCompatButton.(AppCompatButton.java:61) at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:109) at android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1023) at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1080) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:746) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)  at android.view.LayoutInflater.inflate(LayoutInflater.java:515)  at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:286)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)  at com.example.ennie.miniproject.LoginActivity.onCreate(LoginActivity.java:26)  at android.app.Activity.performCreate(Activity.java:6371)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2654)  at android.app.ActivityThread.-wrap11(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1488)  at android.os.Handler.dispatchMessage(Handler.java:111)  at android.os.Looper.loop(Looper.java:207)  at android.app.ActivityThread.main(ActivityThread.java:5728)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679) 

CowardlyVillain avatar May 10 '18 12:05 CowardlyVillain

you need to change AppTheme @styles.xml like its really work

anshkumarsaha avatar May 17 '18 19:05 anshkumarsaha

Interesting, appt2 shouldn't break this, we'll need to raise a bug report to see why it's doing it

chrisjenx avatar May 19 '18 13:05 chrisjenx

I'm having the same issue. The Android drawable "res/drawable-v21/design_password_eye.xml" is not found when inflating TextInputLayout on some devices with Android Lollipop and higher. The same happens with "Calligraphy 3".

sdeff avatar Jun 13 '18 08:06 sdeff

@sshahidaslamm i'll follow your answer but it's give me a new error android.view.InflateException: Binary XML file line #129: Error inflating class TextView. On Emulator it's work perfectly without using your answer but in my device give me a error

ghost avatar Jul 05 '18 11:07 ghost

@techview51 Thanks bro..I complete my app successfully.Just Because of you.Again thanks bro.

sanjayajena37 avatar Jul 14 '18 17:07 sanjayajena37

@techview51 thanks dude..

auzanassdq avatar Aug 25 '18 01:08 auzanassdq

@auzanassdq @sanjayajena37 @allexsv @georgetsiga You are welcome.

techview51 avatar Aug 31 '18 14:08 techview51

@techview51 thanks bro.....my problemis solve

soheltanvir0699 avatar Sep 04 '18 11:09 soheltanvir0699

@soheltanvir0699 You are welcome.

techview51 avatar Sep 04 '18 11:09 techview51

@techview51 Wasted 4 hours trying to solve the problem. The simple copy of image to drawable folder solved. But why does this work?

PrajeetShrestha avatar Sep 11 '18 09:09 PrajeetShrestha

@techview51 Thanks.

zhengwu119 avatar Sep 16 '18 10:09 zhengwu119

@techview51 Are u a hero, sir ? , you just save my life !!!

51600104 avatar Nov 22 '18 10:11 51600104

In my case, I found that I shouldn't use attr / theme reference in color resource. For example, the following color resource caused the problem.

Problem

<color name="title">?attr/colorSpecial</color>
<style name="mytheme" parent="xyz">
  <item name="colorAccent">@color/title</item>
</style>

Solution

Don't use attribute / theme colors directly in color resource that may or may not be in turn used in theme.

<color name="title">@color/colorSpecial</color>
<style name="mytheme" parent="xyz">
  <item name="colorAccent">@color/title</item>
</style>

If you really need theme color (i.e. ?attr/xxx), probably instead of regular color resource, you may need to define another color attribute in your theme.

rpattabi avatar Dec 25 '18 08:12 rpattabi

@sshahidaslamm Thank you, you solved my problem

AnangNawawi avatar Feb 08 '19 12:02 AnangNawawi

Same issue: Solved. My image files were in the "drawable-v24" folder. I copied them to the "drawable" folder too. Problem solved.

You saved my life :+1:

JayTailor45 avatar Mar 21 '19 11:03 JayTailor45

@rpattabi , You are right. Thanks.

Don't use attribute / theme colors directly in color resource that may or may not be in turn used in theme.

@color/colorSpecial

If you really need theme color (i.e. ?attr/xxx), probably instead of regular color resource, you may need to define another color attribute in your theme.

ruman86 avatar May 13 '19 18:05 ruman86

I am facing the issue in textInputLayout Password field

Resource not found exception Drawable drawable/design_password_eye with resource ID #0x7f080098

Please help me to solve this .

this is my build.gradle

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:support-core-ui:28.0.0'
    implementation 'com.android.support:support-vector-drawable:28.0.0'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
        }

Chandrakala14 avatar May 30 '19 08:05 Chandrakala14

hi, all I have the same issue when i use (Android 6): On EditText:

  • android:drawableStart
  • android:background

And on RelativeLayout :

  • android:background ... And when i copy resources from drawable-v24 to drawable it's work fine .

Thank's @techview51

Moonlighter avatar Jul 27 '19 20:07 Moonlighter

@techview51 Wasted 4 hours trying to solve the problem. The simple copy of image to drawable folder solved. But why does this work?

I don't know exactly, just works ;)

techview51 avatar Aug 30 '19 15:08 techview51

@techview51 Thanks.

You are welcome.

techview51 avatar Aug 30 '19 15:08 techview51

@techview51 Are u a hero, sir ? , you just save my life !!!

Glad to hear that. Good luck.

techview51 avatar Aug 30 '19 15:08 techview51

Same issue: Solved. My image files were in the "drawable-v24" folder. I copied them to the "drawable" folder too. Problem solved.

You saved my life 👍

@JayTailor45 Glad to hear that. Good luck.

techview51 avatar Aug 30 '19 15:08 techview51

hi, all I have the same issue when i use (Android 6): On EditText:

  • android:drawableStart
  • android:background

And on RelativeLayout :

  • android:background ... And when i copy resources from drawable-v24 to drawable it's work fine .

Thank's @techview51

You are welcome.

techview51 avatar Aug 30 '19 15:08 techview51

Caused by: android.view.InflateException: Binary XML file line #54: Binary XML file line #54: Error inflating class EditText

I was also getting the similar error, In my case I had added xml file's( icon) with drwable. By adding Normal png images solved the issue.

Adding xml files with drawable causes error many times, sometimes error does not come.

JwalaApporio avatar Sep 06 '19 13:09 JwalaApporio

copied

In my case, no drawable 24 folder exist, nor values and layout.

naveedahmad99 avatar Sep 26 '19 13:09 naveedahmad99

in my case I do not have drawable-24 or 21 in the project

Duna avatar Sep 02 '20 10:09 Duna

Same issue: Solved. My image files were in the "drawable-v24" folder. I copied them to the "drawable" folder too. Problem solved.

Thank you sir, it works fine you save my time

AhmedMahmoudRizk avatar Sep 28 '20 10:09 AhmedMahmoudRizk

Same issue: Solved. My image files were in the "drawable-v24" folder. I copied them to the "drawable" folder too. Problem solved.

Thank you sir, it works fine you save my time

You are welcome.

techview51 avatar Sep 29 '20 05:09 techview51

none of the above solutions solved the issue for me. I'm on android studio 4 canary 15.

aeonSolutions avatar Nov 16 '20 15:11 aeonSolutions

Same issue: Solved. My image files were in the "drawable-v24" folder. I copied them to the "drawable" folder too. Problem solved.

Thanks. This worked for me.

sangeet-shikha avatar Dec 12 '20 11:12 sangeet-shikha

Same issue: Solved. My image files were in the "drawable-v24" folder. I copied them to the "drawable" folder too. Problem solved.

Thanks. This worked for me.

You are welcome.

techview51 avatar Feb 06 '21 08:02 techview51

typedArray.recycle()//must be last line in init function

AbdullahAbuMadi avatar Sep 19 '21 14:09 AbdullahAbuMadi