Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android.view.InflateException: Binary XML file line #19: Error inflating class com.devbrackets.android.exomedia.ui.widget.EMVideoView #270

Closed
1 task
miladz68 opened this issue Jul 4, 2016 · 26 comments
Labels
Milestone

Comments

@miladz68
Copy link

miladz68 commented Jul 4, 2016

  • I have verified there are no duplicate active or recent bugs, questions, or requests
Include the following:
  • ExoMedia version: 3.0.0
  • Device OS version: 4.4.2
  • Devide Manufacturer: LG
  • Device Name: LG G2
    -PHONE_MODEL: LG-D802
Reproduction Steps
  1. play a video in LG G2 using exomedia
Expected Result

exomedia play the video.

Actual Result

exomedia throws an unhandled the exception. I have been able to produce this only in LG G2. on other
devices works fine.

Full Stacktrace

Unable to start activity ComponentInfo{com.rashavas.appido.v069.release/com.milad.appido.ExoMedia.VideoViewActitivity}:
android.view.InflateException: Binary XML file line #19: Error inflating class com.devbrackets.android.exomedia.ui.widget.EMVideoView
dalvik.system.NativeStart in main
com.android.internal.os.ZygoteInit in main at line 608
com.android.internal.os.ZygoteInit$MethodAndArgsCaller in run at line 792
java.lang.reflect.Method in invoke at line 515
java.lang.reflect.Method in invokeNative
android.app.ActivityThread in main at line 5105
android.os.Looper in loop at line 136
android.os.Handler in dispatchMessage at line 102
android.app.ActivityThread$H in handleMessage at line 1200
android.app.ActivityThread in access$800 at line 139
android.app.ActivityThread in handleLaunchActivity at line 2250
android.app.ActivityThread in performLaunchActivity at line 2164
android.app.Instrumentation in callActivityOnCreate at line 1087
android.app.Activity in performCreate at line 5275
com.milad.appido.ExoMedia.VideoViewActitivity in onCreate at line 55
android.app.Activity in setContentView at line 1973
com.android.internal.policy.impl.PhoneWindow in setContentView at line 315
android.view.LayoutInflater in inflate at line 353
android.view.LayoutInflater in inflate at line 397
android.view.LayoutInflater in inflate at line 492
android.view.LayoutInflater in rInflate at line 745
android.view.LayoutInflater in parseInclude at line 839
android.view.LayoutInflater in rInflate at line 755
android.view.LayoutInflater in createViewFromTag at line 696
android.view.LayoutInflater in createView at line 594
java.lang.reflect.Constructor in newInstance at line 423
java.lang.reflect.Constructor in constructNative
com.devbrackets.android.exomedia.ui.widget.EMVideoView in at line 100
com.devbrackets.android.exomedia.ui.widget.EMVideoView in setup at line 614
com.devbrackets.android.exomedia.ui.widget.EMVideoView in readAttributes at line 636
com.devbrackets.android.exomedia.ui.widget.VideoControlsMobile in at line 49
com.devbrackets.android.exomedia.ui.widget.VideoControls in at line 166
com.devbrackets.android.exomedia.ui.widget.VideoControls in setup at line 614
android.view.View in inflate at line 17516
android.view.LayoutInflater in inflate at line 353
android.view.LayoutInflater in inflate at line 397
android.view.LayoutInflater in inflate at line 492
android.view.LayoutInflater in rInflate at line 758
android.view.LayoutInflater in rInflate at line 758
android.view.LayoutInflater in rInflate at line 755
android.view.LayoutInflater in createViewFromTag at line 694
android.view.LayoutInflater in onCreateView at line 669
com.android.internal.policy.impl.PhoneLayoutInflater in onCreateView at line 56
android.view.LayoutInflater in createView at line 594
java.lang.reflect.Constructor in newInstance at line 423
java.lang.reflect.Constructor in constructNative
android.widget.ImageButton in at line 83
android.widget.ImageButton in at line 87
android.widget.ImageView in at line 129
android.content.res.TypedArray in getDrawable at line 602
android.content.res.Resources in loadDrawable at line 2132
android.graphics.drawable.Drawable in createFromXml at line 877
android.graphics.drawable.Drawable in createFromXmlInner at line 933
Caused by: org.xmlpull.v1.XmlPullParserException ("Binary XML file line #1: invalid drawable tag vector")
dalvik.system.NativeStart in main
com.android.internal.os.ZygoteInit in main at line 608
com.android.internal.os.ZygoteInit$MethodAndArgsCaller in run at line 792
java.lang.reflect.Method in invoke at line 515
java.lang.reflect.Method in invokeNative
android.app.ActivityThread in main at line 5105
android.os.Looper in loop at line 136
android.os.Handler in dispatchMessage at line 102
android.app.ActivityThread$H in handleMessage at line 1200
android.app.ActivityThread in access$800 at line 139
android.app.ActivityThread in handleLaunchActivity at line 2250
android.app.ActivityThread in performLaunchActivity at line 2164
android.app.Instrumentation in callActivityOnCreate at line 1087
android.app.Activity in performCreate at line 5275
com.milad.appido.ExoMedia.VideoViewActitivity in onCreate at line 55
android.app.Activity in setContentView at line 1973
com.android.internal.policy.impl.PhoneWindow in setContentView at line 315
android.view.LayoutInflater in inflate at line 353
android.view.LayoutInflater in inflate at line 397
android.view.LayoutInflater in inflate at line 492
android.view.LayoutInflater in rInflate at line 745
android.view.LayoutInflater in parseInclude at line 839
android.view.LayoutInflater in rInflate at line 755
android.view.LayoutInflater in createViewFromTag at line 696
android.view.LayoutInflater in createView at line 594
java.lang.reflect.Constructor in newInstance at line 423
java.lang.reflect.Constructor in constructNative
com.devbrackets.android.exomedia.ui.widget.EMVideoView in at line 100
com.devbrackets.android.exomedia.ui.widget.EMVideoView in setup at line 614
com.devbrackets.android.exomedia.ui.widget.EMVideoView in readAttributes at line 636
com.devbrackets.android.exomedia.ui.widget.VideoControlsMobile in at line 49
com.devbrackets.android.exomedia.ui.widget.VideoControls in at line 166
com.devbrackets.android.exomedia.ui.widget.VideoControls in setup at line 614
android.view.View in inflate at line 17516
android.view.LayoutInflater in inflate at line 353
android.view.LayoutInflater in inflate at line 397
android.view.LayoutInflater in inflate at line 492
android.view.LayoutInflater in rInflate at line 758
android.view.LayoutInflater in rInflate at line 758
android.view.LayoutInflater in rInflate at line 755
android.view.LayoutInflater in createViewFromTag at line 694
android.view.LayoutInflater in onCreateView at line 669
com.android.internal.policy.impl.PhoneLayoutInflater in onCreateView at line 56
android.view.LayoutInflater in createView at line 594
java.lang.reflect.Constructor in newInstance at line 423
java.lang.reflect.Constructor in constructNative
android.widget.ImageButton in at line 83
android.widget.ImageButton in at line 87
android.widget.ImageView in at line 129
android.content.res.TypedArray in getDrawable at line 602
android.content.res.Resources in loadDrawable at line 2136
Caused by: android.content.res.Resources$NotFoundException ("File res/drawable-xxhdpi-v4/exomedia_ic_skip_previous_white.xml from drawable resource ID #0x7f02006b")
dalvik.system.NativeStart in main
com.android.internal.os.ZygoteInit in main at line 608
com.android.internal.os.ZygoteInit$MethodAndArgsCaller in run at line 792
java.lang.reflect.Method in invoke at line 515
java.lang.reflect.Method in invokeNative
android.app.ActivityThread in main at line 5105
android.os.Looper in loop at line 136
android.os.Handler in dispatchMessage at line 102
android.app.ActivityThread$H in handleMessage at line 1200
android.app.ActivityThread in access$800 at line 139
android.app.ActivityThread in handleLaunchActivity at line 2250
android.app.ActivityThread in performLaunchActivity at line 2164
android.app.Instrumentation in callActivityOnCreate at line 1087
android.app.Activity in performCreate at line 5275
com.milad.appido.ExoMedia.VideoViewActitivity in onCreate at line 55
android.app.Activity in setContentView at line 1973
com.android.internal.policy.impl.PhoneWindow in setContentView at line 315
android.view.LayoutInflater in inflate at line 353
android.view.LayoutInflater in inflate at line 397
android.view.LayoutInflater in inflate at line 492
android.view.LayoutInflater in rInflate at line 745
android.view.LayoutInflater in parseInclude at line 839
android.view.LayoutInflater in rInflate at line 755
android.view.LayoutInflater in createViewFromTag at line 696
android.view.LayoutInflater in createView at line 594
java.lang.reflect.Constructor in newInstance at line 423
java.lang.reflect.Constructor in constructNative
com.devbrackets.android.exomedia.ui.widget.EMVideoView in at line 100
com.devbrackets.android.exomedia.ui.widget.EMVideoView in setup at line 614
com.devbrackets.android.exomedia.ui.widget.EMVideoView in readAttributes at line 636
com.devbrackets.android.exomedia.ui.widget.VideoControlsMobile in at line 49
com.devbrackets.android.exomedia.ui.widget.VideoControls in at line 166
com.devbrackets.android.exomedia.ui.widget.VideoControls in setup at line 614
android.view.View in inflate at line 17516
android.view.LayoutInflater in inflate at line 353
android.view.LayoutInflater in inflate at line 397
android.view.LayoutInflater in inflate at line 492
android.view.LayoutInflater in rInflate at line 758
android.view.LayoutInflater in rInflate at line 758
android.view.LayoutInflater in rInflate at line 755
android.view.LayoutInflater in createViewFromTag at line 694
android.view.LayoutInflater in onCreateView at line 669
com.android.internal.policy.impl.PhoneLayoutInflater in onCreateView at line 56
android.view.LayoutInflater in createView at line 594
java.lang.reflect.Constructor in newInstance at line 423
java.lang.reflect.Constructor in constructNative
Caused by: java.lang.reflect.InvocationTargetException
dalvik.system.NativeStart in main
com.android.internal.os.ZygoteInit in main at line 608
com.android.internal.os.ZygoteInit$MethodAndArgsCaller in run at line 792
java.lang.reflect.Method in invoke at line 515
java.lang.reflect.Method in invokeNative
android.app.ActivityThread in main at line 5105
android.os.Looper in loop at line 136
android.os.Handler in dispatchMessage at line 102
android.app.ActivityThread$H in handleMessage at line 1200
android.app.ActivityThread in access$800 at line 139
android.app.ActivityThread in handleLaunchActivity at line 2250
android.app.ActivityThread in performLaunchActivity at line 2164
android.app.Instrumentation in callActivityOnCreate at line 1087
android.app.Activity in performCreate at line 5275
com.milad.appido.ExoMedia.VideoViewActitivity in onCreate at line 55
android.app.Activity in setContentView at line 1973
com.android.internal.policy.impl.PhoneWindow in setContentView at line 315
android.view.LayoutInflater in inflate at line 353
android.view.LayoutInflater in inflate at line 397
android.view.LayoutInflater in inflate at line 492
android.view.LayoutInflater in rInflate at line 745
android.view.LayoutInflater in parseInclude at line 839
android.view.LayoutInflater in rInflate at line 755
android.view.LayoutInflater in createViewFromTag at line 696
android.view.LayoutInflater in createView at line 594
java.lang.reflect.Constructor in newInstance at line 423
java.lang.reflect.Constructor in constructNative
com.devbrackets.android.exomedia.ui.widget.EMVideoView in at line 100
com.devbrackets.android.exomedia.ui.widget.EMVideoView in setup at line 614
com.devbrackets.android.exomedia.ui.widget.EMVideoView in readAttributes at line 636
com.devbrackets.android.exomedia.ui.widget.VideoControlsMobile in at line 49
com.devbrackets.android.exomedia.ui.widget.VideoControls in at line 166
com.devbrackets.android.exomedia.ui.widget.VideoControls in setup at line 614
android.view.View in inflate at line 17516
android.view.LayoutInflater in inflate at line 353
android.view.LayoutInflater in inflate at line 397
android.view.LayoutInflater in inflate at line 492
android.view.LayoutInflater in rInflate at line 758
android.view.LayoutInflater in rInflate at line 758
android.view.LayoutInflater in rInflate at line 755
android.view.LayoutInflater in createViewFromTag at line 694
android.view.LayoutInflater in onCreateView at line 669
com.android.internal.policy.impl.PhoneLayoutInflater in onCreateView at line 56
android.view.LayoutInflater in createView at line 620
Caused by: android.view.InflateException ("Binary XML file line #112: Error inflating class android.widget.ImageButton")
dalvik.system.NativeStart in main
com.android.internal.os.ZygoteInit in main at line 608
com.android.internal.os.ZygoteInit$MethodAndArgsCaller in run at line 792
java.lang.reflect.Method in invoke at line 515
java.lang.reflect.Method in invokeNative
android.app.ActivityThread in main at line 5105
android.os.Looper in loop at line 136
android.os.Handler in dispatchMessage at line 102
android.app.ActivityThread$H in handleMessage at line 1200
android.app.ActivityThread in access$800 at line 139
android.app.ActivityThread in handleLaunchActivity at line 2250
android.app.ActivityThread in performLaunchActivity at line 2164
android.app.Instrumentation in callActivityOnCreate at line 1087
android.app.Activity in performCreate at line 5275
com.milad.appido.ExoMedia.VideoViewActitivity in onCreate at line 55
android.app.Activity in setContentView at line 1973
com.android.internal.policy.impl.PhoneWindow in setContentView at line 315
android.view.LayoutInflater in inflate at line 353
android.view.LayoutInflater in inflate at line 397
android.view.LayoutInflater in inflate at line 492
android.view.LayoutInflater in rInflate at line 745
android.view.LayoutInflater in parseInclude at line 839
android.view.LayoutInflater in rInflate at line 755
android.view.LayoutInflater in createViewFromTag at line 696
android.view.LayoutInflater in createView at line 594
java.lang.reflect.Constructor in newInstance at line 423
java.lang.reflect.Constructor in constructNative
Caused by: java.lang.reflect.InvocationTargetException
dalvik.system.NativeStart in main
com.android.internal.os.ZygoteInit in main at line 608
com.android.internal.os.ZygoteInit$MethodAndArgsCaller in run at line 792
java.lang.reflect.Method in invoke at line 515
java.lang.reflect.Method in invokeNative
android.app.ActivityThread in main at line 5105
android.os.Looper in loop at line 136
android.os.Handler in dispatchMessage at line 102
android.app.ActivityThread$H in handleMessage at line 1200
android.app.ActivityThread in access$800 at line 139
android.app.ActivityThread in handleLaunchActivity at line 2250
android.app.ActivityThread in performLaunchActivity at line 2164
android.app.Instrumentation in callActivityOnCreate at line 1087
android.app.Activity in performCreate at line 5275
com.milad.appido.ExoMedia.VideoViewActitivity in onCreate at line 55
android.app.Activity in setContentView at line 1973
com.android.internal.policy.impl.PhoneWindow in setContentView at line 315
android.view.LayoutInflater in inflate at line 353
android.view.LayoutInflater in inflate at line 397
android.view.LayoutInflater in inflate at line 492
android.view.LayoutInflater in rInflate at line 745
android.view.LayoutInflater in parseInclude at line 839
android.view.LayoutInflater in rInflate at line 755
android.view.LayoutInflater in createViewFromTag at line 696
android.view.LayoutInflater in createView at line 620
Caused by: android.view.InflateException ("Binary XML file line #19: Error inflating class com.devbrackets.android.exomedia.ui.widget.EMVideoView")
dalvik.system.NativeStart in main
com.android.internal.os.ZygoteInit in main at line 608
com.android.internal.os.ZygoteInit$MethodAndArgsCaller in run at line 792
java.lang.reflect.Method in invoke at line 515
java.lang.reflect.Method in invokeNative
android.app.ActivityThread in main at line 5105
android.os.Looper in loop at line 136
android.os.Handler in dispatchMessage at line 102
android.app.ActivityThread$H in handleMessage at line 1200
android.app.ActivityThread in access$800 at line 139
android.app.ActivityThread in handleLaunchActivity at line 2250
android.app.ActivityThread in performLaunchActivity at line 2200
Caused by: java.lang.RuntimeException ("Unable to start activity ComponentInfo{com.rashavas.appido.v069.release/com.milad.appido.ExoMedia.VideoViewActitivity}: android.view.InflateException: Binary XML file line #19: Error inflating class com.devbracket...

@brianwernick
Copy link
Owner

Can you duplicate this with the demo app?

@miladz68
Copy link
Author

miladz68 commented Jul 5, 2016

Can you duplicate this with the demo app?

Yes, I sent the demo app to someone who owns G2, and gets an exception in version 3.0.0 but not in version 2.5.6 .

@brianwernick
Copy link
Owner

brianwernick commented Jul 5, 2016

Caused by: android.content.res.Resources$NotFoundException ("File res/drawable-xxhdpi-v4/exomedia_ic_skip_previous_white.xml from drawable resource ID #0x7f02006b")

Hmm it looks like the platform is looking for an .xml file in the xxhdpi-v4 directory which is really odd because it should be pointing to drawable-xxhdpi-v4/exomedia_ic_skip_previous_white.png

@miladz68
Copy link
Author

miladz68 commented Jul 5, 2016

that's right. it is more odd that so far it has only happened in LG G2.
If I find more data on this I will post it here.
thank you

@se-bastiaan
Copy link
Contributor

I suppose you didn't change anything related to build tools and/or the support library in the gradle file? It looks like something goes wrong in the build process converting the vector drawable to the png. Can you upload the APK you used? I have an old HTC One SV running 4.2.1, maybe I can reproduce this.

@miladz68
Copy link
Author

miladz68 commented Jul 6, 2016

here is the file I sent to a friend to test it for me. but like I said I tested it on different devices such as note 2 which runs on 4.4.2 (same as G2) and it worked fine.

https://drive.google.com/open?id=0ByKbRb-GeCOQY2VCY3Fyc0pOYW81c1dGbGZ4QnhUanNpdW1B

@se-bastiaan
Copy link
Contributor

And do these different devices fall in the xxhdpi category?

@miladz68
Copy link
Author

miladz68 commented Jul 6, 2016

And do these different devices fall in the xxhdpi category?

I just checked it and no they don't.

@se-bastiaan
Copy link
Contributor

se-bastiaan commented Jul 6, 2016

The PNG is in the file, so it must not understand that it should use it. Since it is searching for the XML. I'm at work now, will be home late today. So I'll have to try tomorrow. You can try enabling vector support via appcompat in your own app though. Maybe that'll make a difference.

@miladz68
Copy link
Author

miladz68 commented Jul 7, 2016

vectorDrawables.useSupportLibrary = true

I tried the above command in my build.gradle file in my own project and the problem still persists.

@miladz68
Copy link
Author

miladz68 commented Jul 9, 2016

reproduced this on huawei honor 6 (xxhdpi and runs on 4.4.2)

@se-bastiaan
Copy link
Contributor

se-bastiaan commented Jul 9, 2016

I haven't been able to reproduce this yet and I won't be able to for another week. But it's clear that something related to xxhdpi is going wrong.

@brianwernick
Copy link
Owner

I'm wondering if it has anything to do with https://code.google.com/p/android/issues/detail?id=79325

@miladz68
Copy link
Author

@brianwernick

I'm wondering if it has anything to do with https://code.google.com/p/android/issues/detail?id=79325

you have not enabled the shrink resources in the demo app nor in the library so I don't think that is the cause. the above mentioned issued can be fixed by removing the shrink resources from the gradle file.

@brianwernick
Copy link
Owner

@miladz68 were you ever able to figure out why this was happening? (as I don't have a device that repros it)

@miladz68
Copy link
Author

@brianwernick No I haven't been able to debug this yet, though it is on my to do list. I have received this bug from other devices on my sentry server. It only happens in android 4.4.2 xxhdpi, and I will debug this If I get my hands on a device with that config.

@brianwernick
Copy link
Owner

Hmm, I wonder if something like drawable-anydpi/ instead of drawable will fix the issue (http://stackoverflow.com/a/32271246/2824571), either way it's something that I should probably do

@miladz68
Copy link
Author

miladz68 commented Aug 29, 2016

there is some possibility that this could solve this bug. let me know after you have applied it. I am still looking for a device with this config to fully investigate it.

@brianwernick
Copy link
Owner

brianwernick commented Aug 29, 2016

I'm going to migrate 3.1 to using the support vector library as it's currently using the old .png generation version. This, with the drawable-anydpi should completely mitigate this issue

@brianwernick brianwernick added this to the 3.1.0 milestone Aug 29, 2016
@brianwernick brianwernick mentioned this issue Sep 18, 2016
1 task
@brianwernick
Copy link
Owner

I'm going to close this in the hopes that #313 has fixed the issue. If it doesn't then lets open up a new issue

@pedro-almeida-afterverse
Copy link

pedro-almeida-afterverse commented May 28, 2017

Hello Brian,
this issue is still ocurring on API 19 since I've only found the files at:

res/drawable-anydpi-v21/exomedia_ic_skip_previous_white.xml

You can reproduce this issue by using an API 19 emulator configured as an LDPI device using an exoplayer with a custom VideoControls.

Best regards,

@tonywamba
Copy link

tonywamba commented Oct 18, 2017

Has anyone figured out what is causing this issue? I'm still having it with the lastest exomedia 4.0.2 and all crashes point to that same res/drawable/exomedia_ic_skip_previous_white.xml.

Stack trace:

Exception java.lang.RuntimeException: Unable to start activity ComponentInfo{wee.com.trmex/wee.com.trmex.activities.ExoMediaActivity}: android.view.InflateException: Binary XML file line #59: Error inflating class ImageButton arrow_drop_down Caused by android.view.InflateException: Binary XML file line #59: Error inflating class ImageButton arrow_drop_down Caused by android.content.res.Resources$NotFoundException: File res/drawable/exomedia_ic_skip_previous_white.xml from drawable resource ID #0x7f0200e4 arrow_drop_down Caused by org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector

@rayworks
Copy link
Contributor

@pedro-almeida-clansoft @tonywamba
Check the fix #313 please, it keeps compatible with devices with OS version below 5.0 when using the vector drawable.

Here is a sample layout :

      <ImageView
            android:id="@+id/video_role_play_pause"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:visibility="gone"
            app:srcCompat ="@drawable/exomedia_ic_pause_white" />

@tonywamba
Copy link

tonywamba commented Oct 23, 2017

@rayworks So basically what should I do? I actually use ExoMedia without controls but still getting the same error. I was using 4.0.2 and I just upgraded my lib to 4.0.3.

@brianwernick
Copy link
Owner

@tonywamba This doesn't look like its anything in ExoMedia that is causing the issue, rather that you have referenced the exomedia_ic_skip_previous_white drawable from your own ImageButton (named arrow_drop_down) that isn't using the app:srcCompat that rayworks mentioned

@tonywamba
Copy link

tonywamba commented Oct 23, 2017

@brianwernick Thank you very much. I was referencing that exomedia_ic_skip_previous_white instead of ic_action_skip_previous in my layout by mistake. I blame it on Android Studio 'intellisense' 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants