opentok / opentok-react-native

OpenTok React Native - a library for OpenTok iOS and Android SDKs
https://tokbox.com/
MIT License
212 stars 156 forks source link

Android crash: Exception in native call from JS #357

Closed tomek29k closed 4 years ago

tomek29k commented 5 years ago

Bug Report

Android (Galaxy S9): opentok-android-sdk@2.16.2 opentok-react-native@0.12.1

Current behavior

Crashes when disconnecting from the call. Happens when OTSessionManager.java calls the SDK method mSession.disconnect() of Session.java.

Steps to reproduce

Just leave the call on Android with other users (doesn't happen every time though).

Relevant logs and/or screenshots

Screenshot_20190926-145530_29k dev

og2t commented 5 years ago

@enricop89 Enrico, can you pass this bug to OpenTok SDK team? I'd say it's pretty severe. Thanks!

sharon-systalent commented 5 years ago

Any updates on this? I am having the same issue.

ASerga commented 5 years ago

I have the same issues with the same RN red-box error and traceback.

It happens ONLY while disconnecting the session that has screen sharing subscriber. Maybe because I use this branch https://github.com/ggoldens/opentok-react-native/tree/fix-destroy-publisher (current master branch on opentok-react-natvie has issues on Android)

On the screenshot - Java row that triggers the crash.

Screen Shot 2019-10-22 at 8 56 12 PM

@ggoldens do you need more feedback?

HeroSony commented 5 years ago

I have the same issue, like @tomek29k mentioned. opentok-android-sdk@2.16.2 opentok-react-native@0.12.1

Currently I implemented Live-Room-Video-Chat (one-to-one).

<OTSession
  ref={this.otSessionRef}
  apiKey={roomInfo.apiKey}
  sessionId={roomInfo.sessionId}
  token={roomInfo.token}
  eventHandlers={this.sessionEventHandlers}
>
  <View style={{ flex: 5}}>
    <OTPublisher
      properties={this.publisherProperties}
      eventHandlers={this.publisherEventHandlers}
      style={{ flex: 1 }}
    />
  </View>

  <View
    onLayout={event => {
      this.find_dimesions(event.nativeEvent.layout);
    }}
    style={{ flex: 5 }}
  >
    <OTSubscriber
      properties={this.subscriberProperties}
      eventHandlers={this.subscriberEventHandlers}
      style={{ flex: 1 }}
      streamProperties={this.state.streamProperties}
    />
  </View>
</OTSession>

Above example code disconnect guest session using signal from owner and working fine.

<OTSession
  ref={this.otSessionRef}
  apiKey={roomInfo.apiKey}
  sessionId={roomInfo.sessionId}
  token={roomInfo.token}
  eventHandlers={this.sessionEventHandlers}
>

  <View style={{ flex: 5}}>

     // Creating another Virtual Publisher
     <OTPublisher
       properties={this.virtualPublisherProperties}
       eventHandlers={this.virtualPublisherEventHandlers}
        style={{ height: 0, overflow: 'hidden', }}
    />

    <OTPublisher
      properties={this.publisherProperties}
      eventHandlers={this.publisherEventHandlers}
      style={{ flex: 1 }}
    />
  </View>

  <View
    onLayout={event => {
      this.find_dimesions(event.nativeEvent.layout);
    }}
    style={{ flex: 5 }}
  >
    <OTSubscriber
      properties={this.subscriberProperties}
      eventHandlers={this.subscriberEventHandlers}
      style={{ flex: 1 }}
      streamProperties={this.state.streamProperties}
    />
  </View>
</OTSession>

Above example code, after trying to create a new virtual publisher(attempt to streaming external music in to session) disconnect guest session using signal from owner and produce error:

image

dennistjahyadi commented 5 years ago

i have the same issues. Any Updates?

aslampr07 commented 5 years ago

As a workaround edit node_module/opentok-react-native/andorid/build.gradle, and change the line from implementation 'com.opentok.android:opentok-android-sdk:2.16.1 to implementation 'com.opentok.android:opentok-android-sdk:2.16.2

It is causing the crash because the react version still using an older native SDK. The newest SDK has fixed the crashing problem. see link

ASerga commented 5 years ago

As a workaround edit node_module/opentok-react-native/andorid/build.gradle, and change the line from implementation 'com.opentok.android:opentok-android-sdk:2.16.1 to implementation 'com.opentok.android:opentok-android-sdk:2.16.2

It is causing the crash because the react version still using an older native SDK. The newest SDK has fixed the crashing problem. see link

@aslampr07 I already use v2.16.2. Yes, it helps, but still there is a crash while disconnecting the session that has screen sharing subscriber.

aslampr07 commented 5 years ago

@ASerga can you please checkout the branch '0.12.2' of this repository I think they have fixed the issue, but haven't merged with the master branch.

ASerga commented 5 years ago

@aslampr07 I have tried. It didn't help.

ggoldens commented 5 years ago

Hello guys, apologize for the inconveniences and the delay on this. It looks that there's an issue on the native SDK. I am able to reproduce this issue with a pure android app. I just reported it to the native team. Will keep you posted.

Thanks for reporting!

op commented 4 years ago

@ggoldens We seem to experience this problem all the time. Any updates? :pray:

ASerga commented 4 years ago

@ggoldens We seem to experience this problem all the time. Any updates? 🙏

Yes, It's really critical :( @ggoldens is there an issue in Opentok Android SDK?

enricop89 commented 4 years ago

We released today Android SDK 2.16.3 patch. Please try to update the version on android/build.gradle file and test the issue.

QuevedoIB commented 4 years ago

Tried updating versions, still having problems:

React Native version: 0.59.5 opentok-react-native version: 0.12.1 OpenTok Android SDK version: 2.16.3

Throws an error for OTSession connect expecting 3 arguments and instead receiving 2.

https://github.com/opentok/opentok-react-native/issues/366#issuecomment-562043082

ggoldens commented 4 years ago

Can you guys test the branch 0.12.2? If you see it ok I'll push it asap. Thanks!

ggoldens commented 4 years ago

FYI v0.12.2 it's released. Please confirm us if you still see the issue. Thanks!

tomek29k commented 4 years ago

It seems SDK 2.16.3 has solved the problem for us, haven't tried v0.12.2 yet but will try today. Many thanks @ggoldens!

ggoldens commented 4 years ago

Thanks for the feedback @tomek29k !

ggoldens commented 4 years ago

Will close this issue since it seems to be solved using the latest android SDK.