Skip to content
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][Android] App crashes when attempting to play a second video while another is playing #77

Open
MantasMikal opened this issue Aug 19, 2024 · 3 comments
Labels
bug Something isn't working Groomed JWP team has reviewed the ticket and deemed it necessary native-sdk-issue Work is blocked by native SDK

Comments

@MantasMikal
Copy link

MantasMikal commented Aug 19, 2024

Describe the bug

When playing video while another one is playing causes the app to crash.

It seems that this issue only happens with release builds, specifically on Samsung Galaxy devices with Android 14.
Google Pixel with Android 14 works fine.
All the devices I've tested with Android 13 works fine.

To Reproduce
Clone https://github.com/MantasMikal/jwplayer-react-native-ios-issues

Steps to reproduce the behavior:

  1. Go to 'Dynamic Example' screen
  2. Play the first video
  3. Hit the "Show video" button to insert a new video.
  4. Play the other video

Screenshots / Visual evidence

Screen.Recording.2024-08-19.at.15.28.12.mov

Device(s) affected

  • Device: Samsung Galaxy S24
  • OS: Android 14.0

Additional context

Crash log:

08-19 14:31:44.717 E/RNJWPlayerView( 6324): audioRequest: 1
08-19 14:31:44.812 E/AndroidRuntime( 6324): FATAL EXCEPTION: main
08-19 14:31:44.812 E/AndroidRuntime( 6324): Process: com.rnjwplayer, PID: 6324
08-19 14:31:44.812 E/AndroidRuntime( 6324): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.MEDIA_BUTTON flg=0x10 pkg=com.rnjwplayer (has extras) } in com.jwplayer.pub.api.background.JWMediaButtonReceiver@505830a
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0(LoadedApk.java:1919)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at android.app.LoadedApk$ReceiverDispatcher$Args.$r8$lambda$gDuJqgxY6Zb-ifyeubKeivTLAwk(Unknown Source:0)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run(Unknown Source:2)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at android.os.Handler.handleCallback(Handler.java:958)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at android.os.Handler.dispatchMessage(Handler.java:99)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at android.os.Looper.loopOnce(Looper.java:230)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at android.os.Looper.loop(Looper.java:319)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at android.app.ActivityThread.main(ActivityThread.java:8918)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at java.lang.reflect.Method.invoke(Native Method)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
08-19 14:31:44.812 E/AndroidRuntime( 6324): Caused by: java.lang.NullPointerException: Attempt to read from field 'android.support.v4.media.session.MediaSessionCompat com.jwplayer.api.background.a.a' on a null object reference in method 'void com.jwplayer.pub.api.background.JWMediaButtonReceiver.onReceive(android.content.Context, android.content.Intent)'
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at com.jwplayer.pub.api.background.JWMediaButtonReceiver.onReceive(SourceFile:2048)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0(LoadedApk.java:1911)
08-19 14:31:44.812 E/AndroidRuntime( 6324): 	... 10 more
Full crash log
08-19 15:05:13.834 E/ConstraintLayout(27067): layout_constraintWidth_default="wrap" is deprecated.
08-19 15:05:13.834 E/ConstraintLayout(27067): Use layout_width="WRAP_CONTENT" and layout_constrainedWidth="true" instead.
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): Unhandled SoftException
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): com.facebook.react.bridge.ReactNoCrashSoftException: Cannot get UIManager for UIManagerType: 2
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:92)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:47)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.animated.NativeAnimatedNodesManager.handleEvent(NativeAnimatedNodesManager.java:584)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.animated.NativeAnimatedNodesManager.onEventDispatch(NativeAnimatedNodesManager.java:562)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.uimanager.events.EventDispatcherImpl.dispatchEvent(EventDispatcherImpl.java:116)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java:80)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.ReactRootView.dispatchJSTouchEvent(ReactRootView.java:380)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java:258)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2846)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3328)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2939)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3328)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7678)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7735)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7701)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:7904)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7709)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:7961)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7682)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7735)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7701)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7709)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7682)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:11235)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:11117)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:11073)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:11369)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at 
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:337)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.os.MessageQueue.nativePollOnce(Native Method)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.os.MessageQueue.next(MessageQueue.java:335)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.os.Looper.loopOnce(Looper.java:187)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.os.Looper.loop(Looper.java:319)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.app.ActivityThread.main(ActivityThread.java:8918)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at java.lang.reflect.Method.invoke(Native Method)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
08-19 15:05:16.811 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): Unhandled SoftException
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): com.facebook.react.bridge.ReactNoCrashSoftException: Cannot find EventEmitter for receivedTouches: ReactTag[2131427862] UIManagerType[2] EventName[topTouchStart]
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): 	at com.facebook.react.uimanager.events.ReactEventEmitter.receiveTouches(ReactEventEmitter.java:103)
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): 	at com.facebook.react.uimanager.events.TouchEvent.dispatchModern(TouchEvent.java:192)
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): 	at com.facebook.react.uimanager.events.EventDispatcherImpl$DispatchEventsRunnable.run(EventDispatcherImpl.java:370)
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): 	at android.os.Handler.handleCallback(Handler.java:958)
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): 	at android.os.Handler.dispatchMessage(Handler.java:99)
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): 	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): 	at android.os.Looper.loopOnce(Looper.java:230)
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): 	at android.os.Looper.loop(Looper.java:319)
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): 	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
08-19 15:05:16.812 E/unknown:ReactEventEmitter(27067): 	at java.lang.Thread.run(Thread.java:1012)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): Unhandled SoftException
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): com.facebook.react.bridge.ReactNoCrashSoftException: Cannot get UIManager for UIManagerType: 2
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:92)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:47)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.animated.NativeAnimatedNodesManager.handleEvent(NativeAnimatedNodesManager.java:584)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.animated.NativeAnimatedNodesManager.onEventDispatch(NativeAnimatedNodesManager.java:562)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.uimanager.events.EventDispatcherImpl.dispatchEvent(EventDispatcherImpl.java:116)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java:105)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.ReactRootView.dispatchJSTouchEvent(ReactRootView.java:380)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java:258)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2846)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3328)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2998)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3328)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2998)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3328)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2998)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3328)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2998)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3328)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2998)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:782)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1967)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.app.Activity.dispatchTouchEvent(Activity.java:4548)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:740)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.View.dispatchPointerEvent(View.java:16489)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:8598)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:8349)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7678)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7735)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7701)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:7904)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7709)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:7961)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7682)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7735)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7701)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7709)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7682)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:11235)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:11117)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:11073)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:11369)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:337)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.os.MessageQueue.nativePollOnce(Native Method)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.os.MessageQueue.next(MessageQueue.java:335)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.os.Looper.loopOnce(Looper.java:187)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.os.Looper.loop(Looper.java:319)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at android.app.ActivityThread.main(ActivityThread.java:8918)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at java.lang.reflect.Method.invoke(Native Method)
08-19 15:05:16.903 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
08-19 15:05:16.904 E/unknown:com.facebook.react.uimanager.UIManagerHelper(27067): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): Unhandled SoftException
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): com.facebook.react.bridge.ReactNoCrashSoftException: Cannot find EventEmitter for receivedTouches: ReactTag[2131427862] UIManagerType[2] EventName[topTouchEnd]
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): 	at com.facebook.react.uimanager.events.ReactEventEmitter.receiveTouches(ReactEventEmitter.java:103)
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): 	at com.facebook.react.uimanager.events.TouchEvent.dispatchModern(TouchEvent.java:192)
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): 	at com.facebook.react.uimanager.events.EventDispatcherImpl$DispatchEventsRunnable.run(EventDispatcherImpl.java:370)
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): 	at android.os.Handler.handleCallback(Handler.java:958)
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): 	at android.os.Handler.dispatchMessage(Handler.java:99)
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): 	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): 	at android.os.Looper.loopOnce(Looper.java:230)
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): 	at android.os.Looper.loop(Looper.java:319)
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): 	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
08-19 15:05:16.911 E/unknown:ReactEventEmitter(27067): 	at java.lang.Thread.run(Thread.java:1012)
08-19 15:05:17.017 E/RNJWPlayerView(27067): audioRequest: 1
08-19 15:05:17.079 E/AndroidRuntime(27067): FATAL EXCEPTION: main
08-19 15:05:17.079 E/AndroidRuntime(27067): Process: com.rnjwplayer, PID: 27067
08-19 15:05:17.079 E/AndroidRuntime(27067): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.MEDIA_BUTTON flg=0x10 pkg=com.rnjwplayer (has extras) } in com.jwplayer.pub.api.background.JWMediaButtonReceiver@131f08a
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0(LoadedApk.java:1919)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at android.app.LoadedApk$ReceiverDispatcher$Args.$r8$lambda$gDuJqgxY6Zb-ifyeubKeivTLAwk(Unknown Source:0)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run(Unknown Source:2)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at android.os.Handler.handleCallback(Handler.java:958)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at android.os.Handler.dispatchMessage(Handler.java:99)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at android.os.Looper.loopOnce(Looper.java:230)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at android.os.Looper.loop(Looper.java:319)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at android.app.ActivityThread.main(ActivityThread.java:8918)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at java.lang.reflect.Method.invoke(Native Method)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
08-19 15:05:17.079 E/AndroidRuntime(27067): Caused by: java.lang.NullPointerException: Attempt to read from field 'android.support.v4.media.session.MediaSessionCompat com.jwplayer.api.background.a.a' on a null object reference in method 'void com.jwplayer.pub.api.background.JWMediaButtonReceiver.onReceive(android.content.Context, android.content.Intent)'
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at com.jwplayer.pub.api.background.JWMediaButtonReceiver.onReceive(SourceFile:2048)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0(LoadedApk.java:1911)
08-19 15:05:17.079 E/AndroidRuntime(27067): 	... 10 more

JWP Ticketing

https://support.jwplayer.com/hc/en-us/requests/160147

@MantasMikal MantasMikal added the needs-grooming Has not been reviewed by codeowners for scope/validation label Aug 19, 2024
@Jmilham21 Jmilham21 added bug Something isn't working Groomed JWP team has reviewed the ticket and deemed it necessary native-sdk-issue Work is blocked by native SDK and removed needs-grooming Has not been reviewed by codeowners for scope/validation labels Aug 19, 2024
@Jmilham21
Copy link
Collaborator

Hey @MantasMikal, I have confirmed this does crash on Android 14 devices (tested on a Samsung Galaxy S24 Ultra). The issue is related to the background audio service and how it registers to players.

For a quick solution, I'd recommend only having one player on screen while using the background audio service whenever possible. I understand you may want the audio session to swap between players, but right now this seems problematic.

We will look into this and follow up with findings/solutions. To be clear, could your explain the use case of having multiple players on screen and them all using background audio? What would you expect from the SDK / React Native wrapper?

@MantasMikal
Copy link
Author

MantasMikal commented Aug 21, 2024

Hi @Jmilham21, the app I'm working has a persistent mini-player which sits at the root level and is managed via context. The issue was happening when opening a screen with another video in it and playing it. On other devices the video in the mini-player would pause automatically or start playing at the same time which I think should be the expected behaviour.

Destroying the mini-player in onBeforePlay does fix this problem and I think that works in my case.

Thanks for looking into this!

@Jmilham21
Copy link
Collaborator

Hey @MantasMikal I made a PR around this but it won't solve the underlying issue of attempting to play content across multiple players with background audio on Android. The service wasn't designed for this use case and like you found, there are ways around this by either recreating players or passing a player from view to view with a different approach.

The PR will stop the crash from happening with a warning logged stating why. So it's less of a fix and more of a way to avoid fatal crashes with better in-code documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Groomed JWP team has reviewed the ticket and deemed it necessary native-sdk-issue Work is blocked by native SDK
Projects
None yet
Development

No branches or pull requests

2 participants