Repository navigation
Android debugger failure - Debugging connection was closed. Reason WebSocket disconnected #2542
Description
Activity
Hi @Pip3r4o
Yes this was tested with 2.5.0 AND the @next version (3.0.0-2017-02-09-7977)I've created a short video of me creating a project with 2.5.0 and then trying to debug with Chrome and Genymotion Android:
Alex
Here is the same thing happening with the built in Android emulator:
Alex
@alexziskind1
What version of Chrome are you using?I've tested the debugger on both current stable
Version 56.0.2924.87, as well as on CanaryVersion 58.0.3010.0 canary (64-bit)I also noticed that you have DevTools extensions installed. Could you verify that no Chrome extension modifies the DevTools experience, runs a script on page load, etc. to try to narrow down the possible causes.
Additionally it'd be great if you could provide a logcat log, see if we can find anything useful there.
adb logcat -d > log.txtReacted by Danny FelizThanks! Problem solved!
React Developer Tools Extension was causing this problem.Chrome version is Version 56.0.2924.87 (64-bit)
I've turned off and on all the extensions one at a time and the one that was causing the problem is React Developer Tools.
I've also repeated this on the Windows machine and the same problem was solved there as well.Thanks!
Reacted by Peter Kanev, Danny Feliz and Chet CorcosHaving the same issue. chrome version and android runtime version are the same as above, and cli version is 2.5.1. Turned off all chrome extensions, but still getting the error.
Here's the output of
adb logcat -d
log.txtCould somebody help me?
I had the same issue and as @Pip3r4o said an extension could causing the issue, in my case was Vuejs devtools, I just disabled it and everything works like a charm.
@DannyFeliz Thanks for the response.
But as I mentioned, I turned off all chrome extensions but still getting this error..Having the same issue. Genymotion 2.8.1. Chrome v. 56.0.2924.87. All extensions are disabled. Any updates on that?
same issue guys ? All extensions are disabled !
@AbdallahBedir @terreb Unfortunately this crash isn't something that we can reproduce, so we can't help unless you provide more information about your setup.
What versions are you using?
What browser are you using?chrome://version/
What are your installed extensions?
What device is the app being ran on?
Is it a hello-world tns app?
What is the console log?
What's in the adb logcat at the time of the application crash?adb logcat3 remaining items
@Pip3r4o Thank you for your prompt reply and actually for the help:) It works now!
Feeling myself dumb now. I've already tried to disable all the extensions before, but it didn't work for me. This time I disabled the extensions closed and opened Chrome again, made sure they are still disabled, only then tried and bingo. Many thanks again!
Reacted by Peter Kanev@Pip3r4o May I ask you another related question here, please? I read you guys want to get rid of Safari based NativeScript inspector and switch completely to Chrome web-tools for both platforms (please correct me if I'm wrong). But the thing is debugging in Safari based inspector is much more convenient now rather than in Chrome web-tools in the current state, since the latter is not much different from Node inspector. The former shows more info in the console like function or event name. It allows to expand and collapse objects. Honestly so far, I don't see any upgrades over Node inspector. Probably this is my first impression and I haven't discovered hidden gems.
@terreb We have no plans to replace the Safari Web Inspector for iOS debugging until we can ensure that the Chrome counterpart can provide all functionalities available in Safari.
As for the android debugging experience - we made the switch from the old Node inspector just recently (version 2.5), and have since made many improvements to stabilize it and make it as useful as possible. Version 3.0 will also feature showing of the network requests, allow previewing of all files in the app being debugged, support for the missing Variables tab, and more bug fixes. Very little of that was possible with the now old Node inspector, so the move to Chrome DevTools was the logical thing to do.
Reacted by Alex MantsurovOk got it. Will be toying with the version 3 then. Thank you guys for all your hard work!
I was facing the same issue. In short, creating a new profile on Chrome (People -> Add Person) and debugging from the person fixed the problem for me.
I tried to invalidate ALL extensions from my primary profile then rebooted the machine, but nothing changed. Btw when the error was happening, logcat was showing the following error repeatedly forever even after closing the debug tab in chrome. Hope it helps identifying the issue.
09-28 15:46:31.018 3395 3515 E fi.iki.elonen.NanoHTTPD: java.io.IOException: Broken pipe at android.net.LocalSocketImpl.writeba_native(Native Method) at android.net.LocalSocketImpl.-wrap3(LocalSocketImpl.java) at android.net.LocalSocketImpl$SocketOutputStream.write(LocalSocketImpl.java:144) at fi.iki.elonen.NanoHTTPD$Response.sendBody(NanoHTTPD.java:1750) at fi.iki.elonen.NanoHTTPD$Response.sendBodyWithCorrectEncoding(NanoHTTPD.java:1726) at fi.iki.elonen.NanoHTTPD$Response.sendBodyWithCorrectTransferAndEncoding(NanoHTTPD.java:1716) at fi.iki.elonen.NanoHTTPD$Response.send(NanoHTTPD.java:1683) at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:1011) at fi.iki.elonen.NanoHTTPD$LocalClientHandler.run(NanoHTTPD.java:251) at java.lang.Thread.run(Thread.java:761)Other version stuff when the problem was occuring:
$ tns --version 3.2.1package.json
"nativescript": { "tns-ios": { "version": "3.2.0" }, "tns-android": { "version": "3.2.0" } }, ... "dependencies": { "@angular/animations": "~4.2.0", "@angular/common": "~4.2.0", "@angular/compiler": "~4.2.0", "@angular/core": "~4.2.0", "@angular/forms": "~4.2.0", "@angular/http": "~4.2.0", "@angular/platform-browser": "~4.2.0", "@angular/router": "~4.2.0", "tns-core-modules": "^3.2.0", ... }Chrome version
Version 61.0.3163.100 (Official Build) (64-bit)@Liooo the adb logcat error you've been seeing is the socket connection from/to the chrome devtools being interrupted abruptly (by means of restarting the application, or sometimes when the chrome devtools tab is closed).
@Pip3r4o Probably was missing the time axis
- run
$ tns debug android, then wait for the app to start - run
$ adb logcat#=> shows no errors - open chrome debug URL #=> devtool says "WebSocket disconnected", and logcat start showing the error repeatedly
So I didn't restart the application nor closed the tab.
Guessing some setting of my primary profile was causing the error.- run
I am also facing the same issue, any pointers
tns verion 3.3
tns-android version 3.3.1previously with tns version 3.1.3 it wad working.
@VimalKumarS how and when does the issue occur? In order for us to try and help you, we need a bit more than what you've provided.
What browser are you using? chrome://version/
What are your installed extensions?
What device is the app being ran on?
Is it a hello-world tns app?
What is the console log?
What's in the adb logcat at the time of the application crash? adb logcatI have exactly the same problem as here described
I think this is in correlation with this issue #1872
"tns livesync android` not updating application consistently"
I can see when I connect the debugger with
chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:40001
The files that the debug window shows are not updated...@NishanChakma @usmanghanidev have you fixed it yet?
Reacted by Henok

I am attempting to debug an Android hello world app using chrome at the address specified by the CLI
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=localhost:40000
I'm getting the error in the title show up in Chrome and the message "Unfortunately, has stopped" alert in the Android UI.
There are no console errors.
I've tried this on 2 Macs and 1 Windows machine with the same results.
I've tried this with CLI version 2.5.0 and with CLI 3.0.0-2017-02-09-7977
Android emulator via Genymotion as well as built in emulator are having the same issue