Skip to content

Crash: Assertion Error in DefaultPlaybackSessionManager.updateCurrentSession #2885

@esafirm

Description

@esafirm

Version

Media3 1.6.0

More version details

No response

Devices that reproduce the issue

Various devices, mostly Android 15

Devices that do not reproduce the issue

We cannot reproduce this ourself actually

Reproducible in the demo app?

No

Reproduction steps

This might be more like a question ticket rather than a bug report since we do not know how to reproduce this and we're hitting a wall. But, the code declare that this situation should not happen in the first place.

So I have a couple of questions:

  1. What's a possible cause that this can happen?
  2. Is there a way to replace the DefaultPlaybackSessionManager? If there's what's the easiest way?

Thank you.

Expected result

Not crashing.

Actual result

Assertion error because null object. Here's the stacktrace:

    Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
       at androidx.media3.common.util.Assertions.checkNotNull(Assertions.java:155)
       at androidx.media3.exoplayer.analytics.DefaultPlaybackSessionManager.updateCurrentSession(DefaultPlaybackSessionManager.java:250)
       at androidx.media3.exoplayer.analytics.DefaultPlaybackSessionManager.updateSessionsWithTimelineChange(DefaultPlaybackSessionManager.java:196)
       at androidx.media3.exoplayer.analytics.MediaMetricsListener.maybeAddSessions(MediaMetricsListener.java:330)
       at androidx.media3.exoplayer.analytics.MediaMetricsListener.onEvents(MediaMetricsListener.java:311)
       at androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector.lambda$setPlayer$1(DefaultAnalyticsCollector.java:137)
       at androidx.media3.common.util.ListenerSet$ListenerHolder.iterationFinished(ListenerSet.java:353)
       at androidx.media3.common.util.ListenerSet.handleMessage(ListenerSet.java:297)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:273)
       at android.os.Looper.loop(Looper.java:363)
       at android.app.ActivityThread.main(ActivityThread.java:10060)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
        

Media

Bug Report

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions