androidx / androidx/media

ArrayIndexOutOfBoundsException on getAdGroup (AdPlaybackState.java:832)

Open
#3,037 6 comments 0 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since Jan 29, 2026.

bug
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 1.8.0

More version details

No response

Devices that reproduce the issue

Pixel 7, Samsung S21, Nothing Phone 3a, Lenovo tablet

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps
  • start stream -> wait for DAI commercials -> pause the player mid DAI commercials and wait a few minutes until they suppose to end and resumes the normal stream -> the crash will appear
  • start stream -> wait for DAI commercials -> wait for them to end and the stream will continue -> wait again for DAI commercials and the crash will appear

Observations:
The overlay can sometime vary, ar first it is 1/2 and when the second commercial starts it shows 2/18

Expected result

No crash

Actual result

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException
length=1; index=1

androidx.media3.common.AdPlaybackState.getAdGroup (AdPlaybackState.java:832)
androidx.media3.exoplayer.source.ads.ServerSideAdInsertionMediaSource.setAdPlaybackStates (ServerSideAdInsertionMediaSource.java:176)
androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource.invalidateServerSideAdInsertionAdPlaybackState (ImaServerSideAdInsertionMediaSource.java:834)
androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource.setContentTimeline (ImaServerSideAdInsertionMediaSource.java:808)
androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource.access$2900 (ImaServerSideAdInsertionMediaSource.java:114)
androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource$ComponentListener.lambda$onAdPlaybackStateUpdateRequested$0$androidx-media3-exoplayer-ima-ImaServerSideAdInsertionMediaSource$ComponentListener (ImaServerSideAdInsertionMediaSource.java:1083)
androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource$ComponentListener$$ExternalSyntheticLambda0.run (D8$$SyntheticClass)
android.os.Handler.handleCallback (Handler.java:938)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loopOnce (Looper.java:226)
android.os.Looper.loop (Looper.java:313)
android.app.ActivityThread.main (ActivityThread.java:8751)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1135)

Media

Details of drm and tag dai will be sended to the email android-media-github@google.com

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.