androidx / androidx/media

java.lang.ClassCastException: java.lang.Object cannot be cast to android.util.Pair

Open
#3,325 1 comment 0 reactions 1 assignee View on GitHub

@oceanjules is already working on this.

Since Jul 9, 2026.

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

Description

Version

Media3 1.10.1

More version details

No response

Devices that reproduce the issue

Meizu 17 running android 13

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

No

Reproduction steps
       player.run {
            playWhenReady = false
            repeatMode = ExoPlayer.REPEAT_MODE_OFF
            val source = mediaSource
            if (source != null) {
                setMediaSource(source)
                seekTo(0) //
                player.prepare()
                playerView.player = player
                if (pendingPlayRequestUponSetupPlayer) {
                    playerPool.play(player)
                    pendingPlayRequestUponSetupPlayer = false
                }
            } else {
                playerView.player = null
            }
        }
Expected result

The media plays successfully

Actual result
java.lang.ClassCastException: java.lang.Object cannot be cast to android.util.Pair
	at androidx.media3.exoplayer.AbstractConcatenatedTimeline.getChildTimelineUidFromConcatenatedUid(AbstractConcatenatedTimeline.java:43)
	at androidx.media3.exoplayer.AbstractConcatenatedTimeline.getPeriodByUid(AbstractConcatenatedTimeline.java:217)
	at androidx.media3.exoplayer.ExoPlayerImpl.periodPositionUsToWindowPositionUs(ExoPlayerImpl.java:2911)
	at androidx.media3.exoplayer.ExoPlayerImpl.getCurrentPositionUsInternal(ExoPlayerImpl.java:2191)
	at androidx.media3.exoplayer.ExoPlayerImpl.seekTo(ExoPlayerImpl.java:984)
	at androidx.media3.common.BasePlayer.seekToCurrentItem(BasePlayer.java:414)
	at androidx.media3.common.BasePlayer.seekTo(BasePlayer.java:208)
Media

Not applicable

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.