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.

Crash happening on 2.13.0: ArrayIndexOutOfBoundsException in maybeUpdateAdMediaSources

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
andrewlewiscommented, Mar 11, 2021

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.

2reactions
andrewlewiscommented, Mar 11, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

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