question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Caused by android.content.res.Resources$NotFoundException Drawable (missing name) with resource ID #0x7f08009c

See original GitHub issue

ExoPlayer Version

2.16.1

Devices that reproduce the issue

image

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

No

Reproduction steps

1 in PlayerView Construct(), will create PlayerControlView public PlayerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { this.controller = new PlayerControlView(context, null, 0, attrs); }

2 in PlayerControlView, will infate View with layout public PlayerControlView() { int controllerLayoutId = R.layout.exo_player_control_view;

3 in exo_player_control_view xml layout, has ImageButton <ImageButton android:id="@id/exo_prev" style="@style/ExoMediaButton.Previous"/>

4 which sytle is </style> <style name="ExoMediaButton.Previous"> <item name="android:src">@drawable/exo_controls_previous</item> <item name="android:contentDescription">@string/exo_controls_previous_description</item> </style>

the problem is that the exo_controls_previous drawable could’t be fond。 help me how to resolve this problem!

Expected result

not crash

Actual result

Caused by android.content.res.Resources$NotFoundException Unable to find resource ID #0x7f08009c android.content.res.ResourcesImpl.getResourceName (ResourcesImpl.java:294) android.content.res.ResourcesImpl.loadDrawableForCookie (ResourcesImpl.java:994) android.content.res.ResourcesImpl.loadDrawable (ResourcesImpl.java:729) android.content.res.Resources.loadDrawable (Resources.java:1096) android.content.res.TypedArray.getDrawableForDensity (TypedArray.java:1006) android.content.res.TypedArray.getDrawable (TypedArray.java:981) android.widget.ImageView.<init> (ImageView.java:212) android.widget.ImageButton.<init> (ImageButton.java:96) android.widget.ImageButton.<init> (ImageButton.java:92) android.widget.ImageButton.<init> (ImageButton.java:88) java.lang.reflect.Constructor.newInstance0 (Constructor.java) java.lang.reflect.Constructor.newInstance (Constructor.java:343) android.view.LayoutInflater.createView (LayoutInflater.java:852) android.view.LayoutInflater.createView (LayoutInflater.java:774) com.android.internal.policy.PhoneLayoutInflater.onCreateView (PhoneLayoutInflater.java:58) android.view.LayoutInflater.onCreateView (LayoutInflater.java:928) android.view.LayoutInflater.onCreateView (LayoutInflater.java:948) android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:1002) android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:959) android.view.LayoutInflater.rInflate (LayoutInflater.java:1121) android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:1082) android.view.LayoutInflater.rInflate (LayoutInflater.java:1124) android.view.LayoutInflater.rInflateChildren (LayoutInflater.java:1082) android.view.LayoutInflater.inflate (LayoutInflater.java:680) android.view.LayoutInflater.inflate (LayoutInflater.java:532) android.view.LayoutInflater.inflate (LayoutInflater.java:479) com.google.android.exoplayer2.ui.PlayerControlView.<init> (PlayerControlView.java:421) com.google.android.exoplayer2.ui.PlayerView.<init> (PlayerView.java:498) com.google.android.exoplayer2.ui.PlayerView.<init> (PlayerView.java:318) com.google.android.exoplayer2.ui.PlayerView.<init> (PlayerView.java:314) com.****.MainActivity.onCreate (MainActivity.java:74) android.app.Activity.performCreate (Activity.java:8207) android.app.Activity.performCreate (Activity.java:8191) android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1309) android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3808) android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:4011) android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:85) android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135) android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95) android.app.ActivityThread$H.handleMessage (ActivityThread.java:2325) android.os.Handler.dispatchMessage (Handler.java:106) android.os.Looper.loop (Looper.java:246) android.app.ActivityThread.main (ActivityThread.java:8633) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)

Media

no others

Bug Report

  • You will email the zip file produced by adb bugreport to dev.exoplayer@gmail.com after filing this issue.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Luosohacommented, Oct 27, 2022

Are there any solutions or workarounds yet? I’m getting this crash from 2 different apps’s crashlytics already.

1reaction
angelolloquicommented, Oct 13, 2022

Same issue here, not happening very often but for a few users (~0.1%, with different device manufacturers and OS versions, no apparent pattern there)

...
Caused by android.view.InflateException: Binary XML file line #33 in com.playtomic:layout/exo_player_control_view: Binary XML file line #33 in com.playtomic:layout/exo_player_control_view: Error inflating class ImageButton
Caused by android.view.InflateException: Binary XML file line #33 in com.playtomic:layout/exo_player_control_view: Error inflating class ImageButton
Caused by android.content.res.Resources$NotFoundException: Drawable (missing name) with resource ID #0x7f0801c6
Caused by android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f0801c6
       at android.content.res.ResourcesImpl.getResourcePackageName(ResourcesImpl.java:451)
       at android.content.res.ResourcesImplEx.getResourcePackageName(ResourcesImplEx.java:50)
       at android.content.res.HwResourcesImpl.getThemePackageName(HwResourcesImpl.java:1872)
       at android.content.res.HwResourcesImpl.loadDrawable(HwResourcesImpl.java:1471)
       at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:964)
       at android.content.res.Resources.loadDrawable(Resources.java:1004)
       at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:1195)
       at android.content.res.TypedArray.getDrawable(TypedArray.java:1170)
       at android.widget.ImageView.<init>(ImageView.java:238)
       at android.widget.ImageButton.<init>(ImageButton.java:86)
       at android.widget.ImageButton.<init>(ImageButton.java:82)
       at androidx.appcompat.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:78)
       at androidx.appcompat.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:73)
       at androidx.appcompat.app.AppCompatViewInflater.createImageButton(AppCompatViewInflater.java:226)
       at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:141)
       at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1565)
       at androidx.appcompat.app.PhraseBaseAppCompatDelegate.createView(SourceFile:1)
       at androidx.appcompat.app.PhraseAppCompatDelegate.createView(SourceFile:3)
       at androidx.appcompat.app.PhraseAppCompatDelegate$factory2$1.onCreateView(SourceFile:1)
       at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1071)
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1007)
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:971)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:1133)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1094)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:1136)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1094)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:692)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:536)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:483)
       at com.google.android.exoplayer2.ui.PlayerControlView.<init>(PlayerControlView.java:421)
       at com.google.android.exoplayer2.ui.PlayerView.<init>(PlayerView.java:502)
       at com.google.android.exoplayer2.ui.PlayerView.<init>(PlayerView.java:322)
       at com.google.android.exoplayer2.ui.PlayerView.<init>(PlayerView.java:318)
       at com.playtomicui.components.video.PlaytomicVideoView.<init>(PlaytomicVideoView.kt:66)
       at com.playtomicui.components.video.PlaytomicVideoView.<init>(PlaytomicVideoView.kt:29)
       at com.playtomicui.components.video.PlaytomicVideoView.<init>(:13)
       at java.lang.reflect.Constructor.newInstance0(Constructor.java)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
       at android.view.LayoutInflater.createView(LayoutInflater.java:864)
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1016)
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:971)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:1133)
       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1094)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:692)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:536)
       at com.playtomicui.core.PlaytomicFragment.onCreateView(PlaytomicFragment.kt:62)
       at com.playtomic.modules.onboarding.view.OnboardingAuthFragment.onCreateView(OnboardingAuthFragment.kt:79)
       at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
       at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
       at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
       at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647)
       at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128)
       at androidx.fragment.app.FragmentManager.dispatchPause(FragmentManager.java:3090)
       at androidx.fragment.app.Fragment.performPause(Fragment.java:3161)
       at androidx.fragment.app.FragmentStateManager.pause(FragmentStateManager.java:632)
       at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:314)
       at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647)
       at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128)
       at androidx.fragment.app.FragmentManager.dispatchPause(FragmentManager.java:3090)
       at androidx.fragment.app.FragmentController.dispatchPause(FragmentController.java:284)
       at androidx.fragment.app.FragmentActivity.onPause(FragmentActivity.java:390)
       at android.app.Activity.performPause(Activity.java:8307)
       at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1529)
       at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:5239)
       at android.app.ActivityThread.performPauseActivity(ActivityThread.java:5198)
       at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:5138)
       at android.app.servertransaction.PauseActivityItem.execute(PauseActivityItem.java:46)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:190)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:105)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2462)
       at android.os.Handler.dispatchMessage(Handler.java:110)
       at android.os.Looper.loop(Looper.java:219)
       at android.app.ActivityThread.main(ActivityThread.java:8393)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)

however, in my case compared to the one above, the video player is embeded into some other component of mine, so the XML looks like:


    <com.playtomicui.components.video.PlaytomicVideoView
        android:id="@+id/onboarding_auth_playtomic_video_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clickable="false" />

and the PlaytomicVideoView instantiated the Exo player inside a FrameLayout with:


    private var videoView = PlayerView(context).apply {
        this@PlaytomicVideoView.addView(
            this,
            LayoutParams(
                LayoutParams.MATCH_PARENT,
                LayoutParams.MATCH_PARENT
            ).apply { gravity = Gravity.CENTER_HORIZONTAL }
        )
        if (isInEditMode) {
            setBackgroundColor(ContextCompat.getColor(context, R.color.secondary_energy))
        }
        z = 10F
    }
    ....
        videoPlayer = SimpleExoPlayer.Builder(context).build()
        videoPlayer?.repeatMode = if (isLoop) Player.REPEAT_MODE_ALL else Player.REPEAT_MODE_OFF
        videoView.resizeMode = scaleType.toExoPlayerResize()
        videoView.player = videoPlayer
        videoPlayer?.setMediaSource(getMediaSource(videoUrl))
        videoPlayer?.prepare()
        videoPlayer?.volume = if (autoPlaySound) 1F else 0F
        videoView.useController = false
        videoPlayer?.addListener(object : Player.Listener {
            override fun onPlaybackStateChanged(playbackState: Int) {
                if (playbackState == Player.STATE_ENDED) {
                    playerItemDidPlayToEndTime()
                }
            }
        })
Read more comments on GitHub >

github_iconTop Results From Across the Web

Drawable (missing name) with resource ID even the resource ...
Caused by android.content.res.Resources$NotFoundException: Drawable (missing name) with resource ID even the resource is there · Ask Question.
Read more >
Resources.NotFoundException - Android Developers
public static class Resources.NotFoundException ... android.content.res.Resources. ... public NotFoundException (String name, Exception cause) ...
Read more >
Upgraded from AGP 4.0.2 to 4.1.0 and app crashes with ...
AAR library contains a layout file. When it's inflated, an exception occurs: Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
Read more >
Android.Content.Res.Resources+NotFoundException
I have been trying to create a custom renderer for a button in xamarin forms. I want to set its background with the...
Read more >
android.content.res.Resources$NotFoundException: String ...
android.content.res.Resources$NotFoundException: String resource ID #0x0. The app is crashing when I try to run it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found