2

We have a problem with a React Native app throwing a parent view controller error with the https://github.com/chaimPaneth/react-native-jw-media-player component (React Native wrapper around the native libs)

Essentially we have the component working, although only under the condition that it's nested within a ScrollView, the second we remove the ScrollView and just wrap the component in a standard View we get this error.

Exception thrown while executing UI block: child view controller:<JWPlayerKit.JWPlayerViewController: 0x7f91c807ac00> should have parent view controller:<RNSScreen: 0x7f9168512950> but actual parent is:<UIViewController: 0x7f91aef1d920>

As an example, the following will throw this error and crash the app.

<View>
  <JWPlayer .../>
</View>

This however will work fine, and we have no idea why.

<ScrollView>
  <JWPlayer .../>
</ScrollView>

We can see that RNSScreen is something to do with React Native Screens, but that all appears to be fine, and enabled (we also tried disabling screens and that did nothing)

We're using react-navigation v6 and v0.2.6 of react-native-jw-media-player

I have a feeling this has something to do with the React Navigation and the layering of components or screens.

Can anyone assist here? Does this error mean anything to anyone? We're completely stuck

The full stacktrace we see on screen is:

Exception thrown while executing UI block: child view controller:<JWPlayerKit.JWPlayerViewController: 0x7f91c807ac00> should have parent view controller:<RNSScreen: 0x7f9168512950> but actual parent is:<UIViewController: 0x7f91aef1d920>

__44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke
    RCTUIManager.m:1201
__44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.498
__RCTExecuteOnMainQueue_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start_sim
0x0
0x0```
Cheyne
  • 1,964
  • 4
  • 27
  • 43

1 Answers1

0

Upgrading react-native-jw-media-player to 0.2.19 seems to fix it.

Source and other possible fixes:

https://github.com/chaimPaneth/react-native-jw-media-player/issues/174

Florin Dobre
  • 9,872
  • 3
  • 59
  • 93