livekit / client-sdk-react-native

Official React Native SDK for LiveKit.
https://livekit.io
Apache License 2.0
126 stars 33 forks source link

App crashes on screen share in all Oneplus Nord devices #107

Closed owaisansarii closed 10 months ago

owaisansarii commented 1 year ago

Describe the bug When we are enabling screen-share our app is crashing in android only for one device, neither we are able to share nor the screen is visible when it's being shared by other device We are getting: abort in the sentry logs. Edit: We tried to share screen in one more Oneplus device(Nord CE2), on this device after enabling screenshare the app is freezing and then crashing after 3-4 seconds.

To Reproduce

Steps to reproduce the behavior:

 const startBroadcast = async () => {
    if (Platform.OS === 'ios') {
      const reactTag = findNodeHandle(screenCaptureRef.current);
      await NativeModules.ScreenCapturePickerViewManager.show(reactTag);
    }
    room.localParticipant
      .setScreenShareEnabled(true)
      .then(() => {
        room.localParticipant.setCameraEnabled(false);
        const message = {
          user: userDetails,
          source: 'screen',
          isStopped: false,
          identity: room.localParticipant.identity,
          messageBody: '',
          createdAt: Date.now(),
          type: 'handleScreenShare',
        };
        sendCustomData(message);
        setSourceStream({
          ...message,
          isStopped: true,
        });
      })
      .catch((err) => {
        console.log('err', err);
        Toast('Error starting screen share');
      });
  };

When we call this function in that device the app crashes instantly

Expected behavior

Screenshare should start successfully

Screenshots

WhatsApp Image 2023-10-18 at 1 34 35 AM WhatsApp Image 2023-10-18 at 1 34 36 AM WhatsApp Image 2023-10-18 at 1 34 36 AM(1)

In another oneplus device WhatsApp Image 2023-10-18 at 10 24 42 PM(1) WhatsApp Image 2023-10-18 at 10 24 42 PM

Device Info:

Device model: CPH2467

Brand: Oneplus OS: Android 13

Dependencies Info (please reference your package-lock.json or yarn.lock file):

"@livekit/react-native": "^1.3.0" "@livekit/react-native-webrtc": "^104.0.1" "livekit-client": "^1.9.3"

Additional context Add any other context about the problem here.

whalesnetwork commented 1 year ago

@davidliu any updates?

owaisansarii commented 1 year ago

Process name is , not key_process I discovered this error while reviewing the adb logs.

Additionally, when I reverted back to "@livekit/react-native": "1.0.1" and utilized "react-native-webrtc": "^111.0.6", instead of '@livekit/react-nativ-webrtc', the crash went away.

Could you please investigate the potential cause? This situation is leading to difficulties in maintaining two separate code bases for Android and iOS."

owaisansarii commented 10 months ago

This is fixed in latest version