Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger doesn't work (can't run on Android, on iOS console is not linked) #777

Closed
FRizzonelli opened this issue Aug 27, 2018 · 23 comments
Closed
Assignees
Milestone

Comments

@FRizzonelli
Copy link

Actual Behavior

  1. Run Debug Android
  2. Debugger doesn't start, app isn't builded and launched

Expected Behavior

  1. Run Debug Android
  2. App correctly shipped to device

Software versions

  • React-Native VS Code extension version: Latest
  • VSCode version: Latest
  • OS platform and version: OSx 10.13.5
  • NodeJS version:
  • React Native version: 0.56.0
  • Expo SDK version (include if relevant):

Outputs (Include if relevant)

  • Output of the Debug Console (View -> Toggle Debug Console):
Could not debug. Unknown error: not all success patterns were matched.
It means that "react-native run-android" command failed. Please, check the View -> Toggle Output -> React Native, View -> Toggle Output -> React Native: Run android output windows.
  • Output of the React-Native output channel (View -> Toggle Output -> Select React-Native in ListBox):
[Warning] Target simulator is not supported for Android platform. If you want to use particular device or simulator for launching Android app, please specify  device id (as in 'adb devices' output) instead.

[Info] Using Android SDK location defined in android/local.properties file: /Users/fabriziorizzonelli/Library/Android/sdk.

[Info] Starting React Native Packager.

Scanning folders for symlinks in /Users/fabriziorizzonelli/Code/fatture-in-cloud-beta/node_modules (20ms)
Could not find device with the id: "simulator".
Choose one of the following:
[ 'XXXXXXXX' ]

This is really strange to me, I'm using this extension from like 1 year without a problem. Today all of a sudden it stopped working.
I'm not able to run on Android device (which was working perfectly) and on iOS simulator the app starts but console isn't linked. The weirdest thing is that I didn't update anything, this morning was working, then it stopped 😢

Already tried to:

  • restart VSCode
  • reinstall extension
  • reinstall react-native-cli
  • restart Mac
  • clear node_modules and reinstall all dependencies
  • adb kill-server
  • set again adb reverse tcp
  • change device

I have no more ideas.. Any help is really appreciated!

@edwardlafoy
Copy link

Running into the same issue

@AndrewBoklashko
Copy link

Same problem, wasted a lot of time with it today

@GiovanniFrigo
Copy link

GiovanniFrigo commented Aug 27, 2018

Happens also on my mac, trying to run the same code as @FRizzonelli's

@tbsolutions
Copy link

Same issue. Guess it is related to the latest release (0.6.14) published today.

@aMarCruz
Copy link

aMarCruz commented Aug 27, 2018

Same here.
RN 0.56.0
VS Code 1.26.1
RN-Tools 0.6.14
Linux Mint 16.3

...and the output of console.log is not visible in the "DEBUG CONSOLE" panel anymore :(

@vntguca
Copy link

vntguca commented Aug 28, 2018

Lost some hours on this issue today, simply stopped working for me too.

I can confirm that RN-Tools 0.6.14 is the problem... downgrading to 0.6.13 works fine:

Workaround for downgrading:

1.: Edit your VS Code's user setting to disable auto update by adding the following setting.
"extensions.autoUpdate" : false,

2.: Download the previous version of the RN-Tools extension from this URL
https://ms-vscode.gallery.vsassets.io/_apis/public/gallery/publisher/vsmobile/extension/vscode-react-native/0.6.13/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage

3.: Rename from .VSIXPackage to .VSIX

4.: In VS Code, press CTRL + SHIFT + P or (CMD+SHIFT+P) on Mac, then type VSIX

5.:Enter the the Extension: install from VSIX command. This will launch a file picker windows.

6.: Choose the VSIX file that you've just downloaded.

7.: Reload VS code to enable the installed plug in.

@abruyat
Copy link

abruyat commented Aug 28, 2018

same here! Can't debug my app since 0.6.14. Downgrading work
React-Native VS Code extension version: Latest
VSCode version: Latest
OS platform and version: Fedora 28
NodeJS version: 10
React Native version: 0.56.0
Expo SDK version (include if relevant):

@top-master
Copy link

top-master commented Aug 28, 2018

just downgraded from 0.6.14 to 0.6.13 because of 777 and then downgraded from 0.6.13 to 0.6.12 because of the issue mentioned here but even 0.6.12 has that issue so I will need to wait for the next stable version

@Tilwin90
Copy link

Tilwin90 commented Aug 28, 2018

While the idea of taking the path from local.properties sounds wonderful, it also doesn't work on Windows.
From Android Studio I get the recommendation to set the path as follows:
sdk.dir=C \ : \ \ Users\mihai.veres\AppData\Local\Android\Sdk (extra spaces added to emphasize the actual characters)

However when the extension directly takes this path, it fails and signals that it cannot find the adb command (invalid path).

After unescaping the path above I ran into the same issue as everyone else regarding not being able to find the "simulator" device. I am not trying to run this in a simulator, but on a physical device just like before.
I also "solved" the problem by reverting to 0.6.13.

@xurenzhong
Copy link

xurenzhong commented Aug 28, 2018

update react-native-tools, same to me. now is 0.6.14

I also "solved" the problem by reverting to 0.6.13.

@sdc395
Copy link

sdc395 commented Aug 28, 2018

My target emulated device is named emulator-5554. A step forward seems to be to add the following to .vscode/launch.json...

        "runArguments": [
            "--deviceId", "emulator-5554"
        ]

Unfortunately, this seems to cause both debug and release variants to be built. My release build fails and so debugging doesn't start.

@ruslan-bikkinin
Copy link
Contributor

ruslan-bikkinin commented Aug 28, 2018

Hey guys, we’ve shipped new version of extension v0.6.15 with a fix, please try it out, we are sorry for inconvenience.
Let me know if you see any issues with latest version.

@sdc395
Copy link

sdc395 commented Aug 28, 2018

Thanks for the prompt response, @ruslan-bikkinin. 0.6.15 appears to fix the could not find device with the id: "simulator" problem but I don't get any debug console output from my app. Reverting to 0.6.13 restores the console output.

@vntguca
Copy link

vntguca commented Aug 28, 2018

Still no console output for me too on 0.6.15.

@filmhomage
Copy link

filmhomage commented Aug 28, 2018

Still no console output for me too on 0.6.15.

Reverting to 0.6.13 restores the console output.

Same problem.

@top-master
Copy link

top-master commented Aug 28, 2018

tested 0.6.15 and got below Debug Console output:

OS: win32 ia32
Adapter node: v7.9.0 ia32
vscode-chrome-debug-core: 3.17.3
Starting debugger app worker.
Established a connection with the Proxy (Packager) to the React Native application
Debugger worker loaded runtime on port 42715
******** Unhandled error in debug adapter - Unhandled promise rejection: Error: Cannot connect to runtime process, timeout after {_timeout} ms - (reason: {_error}).
    at Object.runtimeConnectionTimeout (c:\Program Files (x86)\ide\Microsoft VS Code\resources\app\extensions\ms-vscode.node-debug2\node_modules\vscode-chrome-debug-core\out\src\errors.js:91:12)
    at utils.retryAsync.catch.err (c:\Program Files (x86)\ide\Microsoft VS Code\resources\app\extensions\ms-vscode.node-debug2\node_modules\vscode-chrome-debug-core\out\src\chrome\chromeConnection.js:100:49)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:109:7)

and a long run-android output is visible in last edit of this comment

@ruslan-bikkinin
Copy link
Contributor

Hey guys, I’m really sorry for this things happened, I’ve reverted recent changes which broke us for now and created v0.6.16. We’ll investigate and test all the things carefully again but for now things should work as usual. Again I apologise for this, will do our best to prevent such things in future.

@aMarCruz
Copy link

aMarCruz commented Aug 29, 2018

@ruslan-bikkinin , perhaps the isaacs' which utility is convenient for you:

const which = require('which')

/**
 * Find the first instance of the adb executable in the PATH.
 * @returns the normalized path of adb, or null if not found.
 */
function findAdbExec () {
  return which.sync('adb', { nothrow: true })
}

Also, there'are the enviroment vars ANDROID_HOME and ANDROID_SDK_ROOT, but in any case we users can specify the path to the Android SDK in a VS Code settings.

@kryptonian41
Copy link

kryptonian41 commented Aug 30, 2018

I get the following error on the latest version of the extension, on running debug on android

OS: win32 x64 Adapter node: v8.9.3 x64 vscode-chrome-debug-core: 3.17.3 Starting debugger app worker. Established a connection with the Proxy (Packager) to the React Native application Debugger worker loaded runtime on port 34218 ******** Unhandled error in debug adapter: SyntaxError: Unexpected token L in JSON at position 0 at JSON.parse (<anonymous>) at Pipe.channel.onread (internal/child_process.js:470:28)

and also can anyone tell where can i see the console.log(), I am new to using this tool ?

and this is my launch.json

"version": "0.2.0", "configurations": [ { "name": "Debug Android", "program": "${workspaceRoot}/.vscode/launchReactNative.js", "type": "reactnative", "request": "launch", "platform": "android", "sourceMaps": true, "outDir": "${workspaceRoot}/.vscode/.react", "target": "c022be40" }

@ruslan-bikkinin
Copy link
Contributor

Hi @kryptonian41 please see this comment #758 (comment).

;TLDR This is a nodejs issue, use nodejs v10.5 or lower to avoid it until v10.10 will be released.

@msnikhil
Copy link

msnikhil commented Aug 31, 2018

I installed the extension 3 days ago and faced the same issue mentioned by @Tilwin90 here in this comment thread.

Then I uninstalled the extension but since then my react-native app builds successfully but doesn't open in debug mode. However, bundling in the release mode, the app opens successfully. More on this issue in my SO question here.

I also created a new react-native project and pulled the working code of my app into the new RN project but still the issue persists. Interestingly, my other react-native apps open in the debug mode except for the one in which I installed this extension. Please help.

@ruslan-bikkinin
Copy link
Contributor

Hi @msnikhil, could you please submit separated issue? I am guessing that your problem is not connected with the one being discussed in this thread.

@ruslan-bikkinin ruslan-bikkinin added this to the 0.6.17 milestone Sep 12, 2018
@ruslan-bikkinin
Copy link
Contributor

Hi guys, we just released v0.6.17 that included all the fixes for given problems and get back changes reverted from 0.6.14-0.6.15. That's why I am going to close this issue, so if problem is still persists for anybody (it shouldn't though) please submit new issue.

@microsoft microsoft locked as resolved and limited conversation to collaborators Sep 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests