Android emulator loses connection to debugger and becomes unresponsive
To reproduce:
- Fire up a Genymotion emulator
react-native run-androidon your project- Attach chrome debugger
- Put an error in javascript, for example
returnsinstead ofreturn - Refresh your emulator (Cmd M, Reload)
- Fix the error in your code
- Refresh your emulator (Cmd M, Reload) again
- Emulator will display dialog that says "Please wait.. connecting to remote debugger"
- There is no way to exit this state, except to close and reboot the emulator
Errors caught in the debugger in this situation are:
GET http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false 500 (Internal Server Error) debuggerWorker.js:18 Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false' failed to load.messageHandlers.executeApplicationScript @ debuggerWorker.js:18onmessage @ debuggerWorker.js:33
I use Genymotion, usually test on APIs 16 & 21 which have both experienced this issue.
I am running React Native version 0.20.
I am running on a Mac.
I've heard about this, might be something that got broken between 0.19 and 0.20. Does anyone know the root cause?
Confirmed. Very frustrating. You can press the hardware buttons to go to say the home screen so the device is responsive, but the "Connecting to the remote debugger' popup stays on top of everything so you click click anywhere.
Seen this quite frequently on 0.17 as well
This happens on 0.21, 0.22 with stock emulator, with Genymotion.
Confirmed Ubuntu with RN 0.21 and 0.22 and Genymotion
I've upgraded to latest and debug in chrome was not working. So I created a new app from scratch using react-native-cli 2.0. Debugging was working. So I compared all android files for things missed by the upgrade script.
I've found the following differences:
allprojects { repositories { mavenLocal() jcenter() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$projectDir/../../node_modules/react-native/android" } } }
android/app/build.gradle the compile version was still showing 0.18
dependencies { compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" }
I rebuilt the app, now Debugging works again. Hope it helps. Santiago
I get this in chrome console: debuggerWorker.js:18 Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false' failed to load. I'm using the android emulator and it also gets stuck on that message: Please wait...Connecting to remote debugger.
How to stop this without shutting down all processes?
I thought this was fixed but it's still a problem.
The issue went away a while ago for me, but now it's back. Maybe it has something to do with promises? I started using AsyncStorage last week. No errors come up, although I do sometimes get the unhandled promise rejection warning for no apparent reason.
Don't even have asyncstorage, blank project with only react-native-maps and it does it here and then. Very annoying to recover from.
the fastest way to recover I found out is to ctrl+c then [up], [enter] the packager. This way the app crashes instantly and I can reload.
Any other way makes android hang for ages.
@ThaJay could you expand what you mean by [up], [enter] the packager? I'm having this problem as well (and also wonder if it has something to do with promises)
I just meant running the command again in your terminal. But in the newer versions it seems you can just press the back button on device or emulator to cancel the loading modal so you can open the dev menu again.
same issue genymotion and real device windows 10 and osx 10.11.6 react-native 0.33
This issue is a real bummer. Having remote JS debugging and live reloading both enabled causes constant issues because of this -- if you save a file with a syntax error everything breaks and you have to kill and reload the app manually.
Press the back button on device or emulator to cancel the loading modal doesn't work for me using 0.34. The fastest way to recover I found to kill the app:
adb shell am force-stop com.my.app.package
where com.my.app.package is the package name
i hope this can help you,it help me solution this problem. [(http://stackoverflow.com/questions/41088268/conditional-rendering-error-in-react-native)]
Closing this issue because it has been inactive for a while. If you think it should still be opened let us know why.
I still have this issue with 0.48RN, where if I enable debug remotely and uses react native debugger at jhen0409/react-native-debugger, the app in genymotion just basically stops working.