react-native: Remote JS Debugging crashes app after 30 seconds
Description
When using Remote JS Debugging
the app crashes after exactly 30 seconds.
Without Remote JS Debugging
the app works just fine.
Reproduction
This also happens on a brand new project created like this:
react-native init AwesomeProject
cd AwesomeProject
react-native run-android
Just enable Remote JS Debugging
, reload and wait for 30 seconds - the app will crash.
Solution
?
Additional Information
- React Native version: 0.41.2
- Platform: Android (haven’t tried IOS yet)
- Operating System: Windows (haven’t tried macOS yet)
- JS Debugger: Chrome Dev Tools, React Native Debugger
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 41
- Comments: 35 (5 by maintainers)
The issue seems to be that the React Native code is running a network call on the UI Thread 🤦♂️ So I have a workaround…
NOTE: Don’t ship this in your release builds as you should never run network calls on the UI Thread. This workaround is just to get debugging working until a proper fix is made by Facebook
In
MainApplication.java
do the following…I am still getting same error
“react-native”: “0.47.1”,
nw_connection_get_connected_socket 287 Connection has no connected handler TCP Conn 0x60000017ce00 Failed : error 0:61 [61]
Still happening to me with RN 0.51.0 and 0.52.0
Looking for help!!!
In order to get @mrbrentkelly workaround compiled, add these 3 lines on top:
Unfortunately the app will still crash as soon as Remote Debugger Mode was activated.
Anything new about this issue? It’s really a pain to develop with the debugger on, as the app crashes 50% of the time when reloading 😞
React Native version: 0.38.0 IOS
It crashes my app right after I open it
I’m having this problem on
0.60.0
UPDATE: I was updating my project when finding the error, so to make sure I create a new one from scratch. The problem is not solved, the error is the same.
This line in
AndroidManifest.xml
may help:Read more:
Crashes right after turning debug on from the dev menu
React Native version: 0.42 Platform: iOS OS: OS X 10.11.6 JS Debugger: Chrome Dev Tools, React Native Debugger