React-native: cannot bind listener: Address already in use

Created on 29 Aug 2019  路  3Comments  路  Source: facebook/react-native

When trying to run on Android device:

info Connecting to the development server...
adb.exe: error: cannot bind listener: Address already in use
warn Failed to connect to development server using "adb reverse": Command failed: \AppData\Local\Android\Sdk/platform-tools/adb -s RQ3000JTY2 reverse tcp:8081 tcp:8081
info Starting the app on "RQ3000JTY2"...
Starting: Intent { cmp=com.test/.MainActivity }

React Native version:

System:
    OS: Windows 10
    CPU: (2) x64 Intel(R) Pentium(R) CPU G3220 @ 3.00GHz
    Memory: 9.43 GB / 15.89 GB
  Binaries:
    Node: 10.16.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.17.3 - C:\Users\Dxenu\AppData\Roaming\npm\yarn.CMD
    npm: 6.11.2 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    Android Studio: Version  3.5.0.0 AI-191.8026.42.35.5791312
# Before Metro bundler start
netstat -anbo | findStr "8081"
-
# After
netstat -anbo | findStr "8081"
  TCP    0.0.0.0:8081           0.0.0.0:0              LISTENING       8580
  TCP    [::]:8081              [::]:0                 LISTENING       8580

Bundler is halted at Loading dependency graph, done.

Steps To Reproduce

  1. npm i -g @react-native-community/cli
  2. react-native init test
  3. react-native run-android
Bug

Most helpful comment

OK, closing, solved it by running adb usb.

All 3 comments

OK, closing, solved it by running adb usb.

I want to debug my react native android app using my android device(Oreo).
adb -s <device name> reverse tcp:8081 tcp:8081
the above command gives me "adb.exe: error: cannot bind listener: Address already in use" error.
if i search for port process with command netstat -anbo | findStr "8081" It shows nothing.

the above command gives me "adb.exe: error: cannot bind listener: Address already in use" error.

I solved this by running adb usb first then adb reverse tcp:8081 tcp:8081. Hope this helps you!

Was this page helpful?
0 / 5 - 0 ratings