Vscode-react-native: Cannot bind listener: operation not permitted

Created on 15 Jun 2019  路  7Comments  路  Source: microsoft/vscode-react-native

Actual Behavior

[Error] Error: Error while executing command 'adb -s "emulator-5554" reverse tcp:8081 tcp:8081': Error while executing command 'adb -s "emulator-5554" reverse tcp:8081 tcp:8081': Command failed: adb -s "emulator-5554" reverse tcp:8081 tcp:8081
adb.exe: error: cannot bind listener: Operation not permitted

using android studio adv
I set path to platform-tools

Starting custom debugger by executing: echo A debugger is not needed:

Expected Behavior

I would like to debug step, but i get this error, and the top bar for stopping or debugging disappears.

Software versions

  • React-Native VS Code extension version: 0.9.3
  • VSCode version: 1.35.1
  • Windows 10
  • NodeJS version: npm: '6.9.0',
  • React Native version: "react-native": "0.59.9",

Outputs (Include if relevant)

  • Output of the Debug Console (View -> Toggle Debug Console):
OS: win32 x64
Adapter node: v10.2.0 x64
vscode-chrome-debug-core: 6.7.46
Could not debug. Error while executing command 'adb -s "emulator-5554" reverse tcp:8081 tcp:8081': Error while executing command 'adb -s "emulator-5554" reverse tcp:8081 tcp:8081': Command failed: adb -s "emulator-5554" reverse tcp:8081 tcp:8081
adb.exe: error: cannot bind listener: Operation not permitted

  • Output of the React-Native output channel (View -> Toggle Output -> Select React-Native in ListBox):
[Info] Packager is already running.

[Info] Prewarming bundle cache. This may take a while ...

[Info] About to get: http://localhost:8081/index.bundle?platform=android

[Warning] The Bundle Cache was prewarmed.

[Info] Building and running application.

 BUNDLE  [android, dev] ./index.js 鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔 100.0% (1/1), done.

[Error] Error: Error while executing command 'adb -s "emulator-5554" reverse tcp:8081 tcp:8081': Error while executing command 'adb -s "emulator-5554" reverse tcp:8081 tcp:8081': Command failed: adb -s "emulator-5554" reverse tcp:8081 tcp:8081
adb.exe: error: cannot bind listener: Operation not permitted


Starting custom debugger by executing: echo A debugger is not needed:  "c:\Project\Harborapp"

  • Output of the Developer Tools console (Help -> Toggle Developer Tools -> Select Console tab):
workbench.main.js:4357 Overwriting grammar scope name to file mapping for scope source.js.
Old grammar file: file:///c%3A/Users/Origin/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/javascript/syntaxes/JavaScript.tmLanguage.json.
New grammar file: file:///c%3A/Users/Origin/.vscode/extensions/mgmcdermott.vscode-language-babel-0.0.22/grammars/Babel-Language.json
register @ workbench.main.js:4357
workbench.main.js:3313 [Extension Host] debugger listening on port 36911
workbench.main.js:238 [Extension Host] (node:2692) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ workbench.main.js:238
workbench.main.js:238 [Extension Host] (node:2692) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
android external resolved

Most helpful comment

Hello, changing the platform tools didn't help, however as mentioned, i've switched the emulator api to version 28 and everything works as intended. Thanks!
I guess we'll have to wait for 29 to be stable.

All 7 comments

Hi @OriginLive and thanks for questionning. It looks like an adb problem, so I'd suggest you to try to restart adb server:

adb kill-server
adb start-server

Please let us know if it works.

adb start-server

  • daemon not running; starting now at tcp:5037
  • daemon started successfully

however no change. What's wrong with my adb?

Hi @OriginLive . This issue looks similar to #1026 and #1027. Could you please check your Android SDK Platform Tools version? If it equals 29 then I recommend you to downgrade tools version to 28, because there was some bugs introduced in this version. To do that please do the following:

Please let us know if this works for you.

It looks like this behaviour is found on Android Q Beta emulators. Google team already informed about that: https://issuetracker.google.com/issues/133771463

Hello, changing the platform tools didn't help, however as mentioned, i've switched the emulator api to version 28 and everything works as intended. Thanks!
I guess we'll have to wait for 29 to be stable.

@OriginLive Glad to hear that your issue is resolved.

Hello, I had similar issue on emulator, using Android SDK Platform Tools Version 29.
I was able to work around this following these steps:

Follow below steps:-

  1. adb kill-server
  2. adb root

Reference

Was this page helpful?
0 / 5 - 0 ratings