question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Native Crash upon calling dataChannel.send

See original GitHub issue

After receiving the the open event for a created data channel, attempting to send always crashes the react native app and brings up the red box with the following stack trace java.lang.Double cannot be converted to java.lang.String getString:102, ReadableNativeArray (com.facebook.react.bridge) extractArgument:73, JavaMethodWrapper$5 (com.facebook.react.bridge) extractArgument:69, JavaMethodWrapper$5 (com.facebook.react.bridge) invoke:356, JavaMethodWrapper (com.facebook.react.bridge) invoke:151, JavaModuleWrapper (com.facebook.react.bridge) run:-1, NativeRunnable (com.facebook.react.bridge.queue) handleCallback:938, Handler (android.os) dispatchMessage:99, Handler (android.os) dispatchMessage:27, MessageQueueThreadHandler (com.facebook.react.bridge.queue) loop:246, Looper (android.os) run:226, MessageQueueThreadImpl$4 (com.facebook.react.bridge.queue) run:923, Thread (java.lang)

Expected behavior

Data channel sends message to peer.

Observed behavior

Crash and exception above

Steps to reproduce the problem

Create a data channel and attempt to send string message

Platform information

  • React Native version:
  • 0.63.4
  • Plugin version:
  • 1.89.3 1.89.1
  • OS:
  • Android
  • OS version:
  • Android 11

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cooktcommented, Jul 27, 2021

I retested it today with a clean environment and confirmed that the id parameter doesn’t matter for 1.89.3. What likely happened was that I had 1.89.1 still cached (this was only other version I’ve used of this plugin). I’ve updated the initial report to reflect that. Thanks for investigating and apologies for the trouble.

0reactions
Shahanshah87commented, Oct 4, 2022

The one change that eliminated this error was the following: peerConnection.createDataChannel(DATA_CHANNEL_NAME) -> peerConnection.createDataChannel(DATA_CHANNEL_NAME, {id: 1})

can you please share code for data channel as I am unable to do that

Read more comments on GitHub >

github_iconTop Results From Across the Web

[iOS] dataChannelDidChangeState crash · Issue #962 - GitHub
Connecting to a peer should not make the app crash randomly on iOS. Platform information. React Native version: 0.63.4; Plugin version: 1.89.1 ...
Read more >
WebRTC DataChannel not opening on iOS native app
Currently try to reimplement oficial sample with local transfer (https://github.com/webrtc/samples/blob/gh-pages/src/content/datachannel/ ...
Read more >
App immediatly crash after installing react-native-webrtc - Help
I just created a new app (react 16.11 and react-native 0.62) , installed ... Crashing on android after following thorough installation process.
Read more >
Did I choose the right WebRTC stack?
JS binding called node-datachannel to make some connectivity tests on top of my Node.JS application. The Node.JS library is really easy to use ......
Read more >
RTCPeerConnection.createDataChannel() - Web APIs | MDN
This example shows how to create a data channel and set up handlers for the open and message events to send and receive...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found