简体   繁体   中英

How to fix adb: error: cannot bind listener: Operation not permitted react-native?

I'm using Android Studio version 3.4.2, the latest, on Ubuntu 18.04LTS trying to run a react-native app in the emulator(NEXUS 5X API 29).

When I run react-native run-android

I get this

BUILD SUCCESSFUL in 1m 54s
27 actionable tasks: 2 executed, 25 up-to-date
info Connecting to the development server...
adb: error: cannot bind listener: Operation not permitted
warn Failed to connect to development server using "adb reverse": Command failed: /home/user/Android-SDK/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
info Starting the app on "emulator-5554"...
Starting: Intent { cmp=com.albums/.MainActivity }

But the app doesn't run or start.

MY SDK LOCATION IS RIGHT /home/user/Android-SDK

My .bashrc has these lines

export ANDROID_HOME=$HOME/Android-SDK
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

My local.properties file in my react-native android project directory has sdk.dir=/home/user/Android-SDK

The SDK location is right in the android studio SDK manager as well.

What should I do?

It was a problem with adb ,fixed it with adb kill-server then adb root . solution link

Also for some reason react-native run-android didn't work react-native start worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM