Crash happening on 2.13.0: ArrayIndexOutOfBoundsException in maybeUpdateAdMediaSources
See original GitHub issueI want to report a crash using exoplayer v2.13.0 and googleIMA 3.22.0. It’s a TV app in which we have a DAI video and other VOD videos with prerolls/midrolls. Not sure if it’s crashing on live video (DAI) or VOD. Since we updated Exoplayer to 2.13.0 this crash started happening:
Fatal Exception: java.lang.ArrayIndexOutOfBoundsException
length=0; index=1
com.google.android.exoplayer2.source.ads.AdsMediaSource.maybeUpdateAdMediaSources (AdsMediaSource.java:316)
com.google.android.exoplayer2.source.ads.AdsMediaSource.onAdPlaybackState (AdsMediaSource.java:295)
com.google.android.exoplayer2.source.ads.AdsMediaSource.access$100 (AdsMediaSource.java:58)
com.google.android.exoplayer2.source.ads.AdsMediaSource$ComponentListener.lambda$onAdPlaybackState$0 (AdsMediaSource.java:385)
com.google.android.exoplayer2.source.ads.AdsMediaSource$ComponentListener.lambda$onAdPlaybackState$0$AdsMediaSource$ComponentListener (AdsMediaSource.java:7)
com.google.android.exoplayer2.source.ads.-$$Lambda$AdsMediaSource$ComponentListener$0n-PEDqeEt9IJPXJ3J126o4e0MQ.run (-.java:7)
android.os.Handler.handleCallback (Handler.java:751)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:154)
android.os.HandlerThread.run (HandlerThread.java:61)
I believe this might be a crash in the Exo SDK itself since we’re not seeing any reference to our code in the stack trace, but even if it’s not could you provide me any information on what could be causing this, as well as any tips to fix it?
- ExoPlayer version 2.13.0
- IMA version 3.22.0
- Android 7 47% of crashes
- Android 5 45% of crashes
- Android 9 8% of crashes
- Android device: Amazon AFTT/AFTTM
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:16 (8 by maintainers)
Top Results From Across the Web
ExoPlayer Crash happening on 2.13.0 ... - GitAnswer
ExoPlayer Crash happening on 2.13.0: ArrayIndexOutOfBoundsException in maybeUpdateAdMediaSources - Java. I want to report a crash using exoplayer v2.13.0 ...
Read more >Crash when changing render distance / java.lang ... - Jira
Crash when changing render distance / java.lang.ArrayIndexOutOfBoundsException: Index 28084 out of bounds for length 26136.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To clarify, I’m planning to fix the bug anyway (at which either ordering should work again), but if you need a quick fix without waiting for an ExoPlayer release or patch then swapping the order of the calls should do it.
I’m planning to look into this today. Yes, there may is probably a size check missing, but I want to find the code path that’s causing the size to be out of synch just to make sure this isn’t a symptom of another bug.