nativescript-community / nativescript-vscode-extension

A Visual Studio Code Extension for NativeScript
https://www.nativescript.org/visual-studio-code
Apache License 2.0
82 stars 32 forks source link

Application stops after attaching debugger #120

Closed hshristov closed 6 years ago

hshristov commented 7 years ago

If you start an application with tns run android and try to attach VS Code debugger applications stops.

petekanev commented 7 years ago

I wasn't able to reproduce the application crash.

tns create hello-world --tsc cd hello-world tns platform add android@next tns run android #open project in code #create configuration; attach to Android

Resulting output:

[NativeScriptCli] execute: tns --version
[NSDebugAdapter] Using tns CLI v3.0.0 on path 'tns'
[NSDebugAdapter] Running tns command...
[NativeScriptCli] execute: tns debug android --no-client --start 
[NSDebugAdapter] Watching the tns CLI output to receive a connection token
device: 192.168.56.101:5555 debug port: 40000
[NSDebugAdapter] Ready to attach to application on 40000
[NSDebugAdapter] Connection to target application established on 40000
[NSDebugAdapter] The tns command finished its execution with code 0.
[NSDebugAdapter] Connection to target application successfully enabled
pkoleva commented 7 years ago

Seems the issue is no longer active, me and @hshristov couldn't reproduce it with CLI 3.0.1, VS Code 1.12.2 and NS Extension 0.7.0.

xho commented 7 years ago

After some updates now this happens to me always, with launch or attach.

If I run the application with tns run android it works, but if I try to attach while running it stops. No debug information given, only an alert saying the application “has stopped“, and “open app again” (but it opens without debugger attached).

If I run with tns debug android, it starts. But as soon as i try to connect in Chrome with chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:40000 tha application stops.

petekanev commented 7 years ago

@xho so the application crashes while trying to establish socket connection with the debugging frontend. I'd be more than happy to help you debug the problem. Would you mind sharing a repository with the code where the problem can be reproduced?

xho commented 7 years ago

@Pip3r4o I am sorry: I am working on a component of a very large app and I don't own the full code so I cannot share. :/ I can add that the problem does not happen with a brand new hello-world based application. I will try to discover some more or eventually ask permission to share the code to the owner.

petekanev commented 7 years ago

@xho any small sample that can reproduce the problem consistently is appreciated. Make sure to remove any sensitive information there may be.

Plamen5kov commented 6 years ago

closing due to inactivity