-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: Exception java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Class.getName()' on a null object reference #3901
Comments
can you please tell me which react native version do you use ? |
@paulrinaldi @KrzysztofMoch I am reviewing the code, there is something I can point regarding to this crash: |
I'm using react-native version 0.74.2, and only once video view |
@freeboub I have same crashes reported in Crashlytics. I was able to reproduce. When I have 2 videos in notification, then closing one and resuming another makes the crash. |
@arsensgitacc can you please try this patch, I think it will fix the issue fun unregisterPlayer(player: ExoPlayer) {
hidePlayerNotification(player)
val session = mediaSessionsList.remove(player)
session?.release()
- sourceActivity = null
if (mediaSessionsList.isEmpty()) {
cleanup()
stopSelf()
}
} |
@freeboub yeah, not crashing anymore. Thanks!! |
I don't think so, but I would like a feedback from @KrzysztofMoch and / or @paulrinaldi |
I couldn't reproduce this problem on my physical device or simulator. I tested the patch in simulator and notifs work fine for me (closing notif, close a video and reopen a new video). I agree that this null assignment should be unnecessary as well since it is set to null in the beginning of the kotlin file. Though, I have less kotlin experience than Java... LGTM |
Thank you @paulrinaldi , I will open a PR with this change |
Version
6.2.0
What platforms are you having the problem on?
Android
System Version
9,10,12,13
On what device are you experiencing the issue?
Real device
Architecture
Old architecture
What happened?
Exception java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Class.getName()' on a null object reference
at android.content.ComponentName. (ComponentName.java:133)
at android.content.Intent. (Intent.java:7425)
at com.brentvatne.exoplayer.VideoPlaybackService.createSessionNotification (VideoPlaybackService.kt:118)
at com.brentvatne.exoplayer.VideoPlaybackService.onUpdateNotification (VideoPlaybackService.kt:88)
at androidx.media3.session.MediaSessionService.onUpdateNotificationInternal (MediaSessionService.java:538)
at androidx.media3.session.MediaNotificationManager$MediaControllerListener.onEvents (MediaNotificationManager.java:335)
at androidx.media3.session.MediaControllerImplBase.lambda$new$0$androidx-media3-session-MediaControllerImplBase (MediaControllerImplBase.java:157)
at androidx.media3.session.MediaControllerImplBase$$ExternalSyntheticLambda85.invoke
at androidx.media3.common.util.ListenerSet$ListenerHolder.iterationFinished (ListenerSet.java:350)
at androidx.media3.common.util.ListenerSet.handleMessage (ListenerSet.java:294)
at androidx.media3.common.util.ListenerSet.$r8$lambda$bio3pd12v5B_9b5UeFaPn9XBQ90
at androidx.media3.common.util.ListenerSet$$ExternalSyntheticLambda0.handleMessage
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loopOnce (Looper.java:240)
at android.os.Looper.loop (Looper.java:351)
at android.app.ActivityThread.main (ActivityThread.java:8377)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:584)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1013)
Reproduction
No response
Reproduction
showNotificationControls={true}
on AndroidThe text was updated successfully, but these errors were encountered: