简体   繁体   English

如何修复 adb: error: cannot bind listener: Operation not allowed react-native?

[英]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).我在 Ubuntu 18.04LTS 上使用最新的 Android Studio 版本 3.4.2,试图在模拟器(NEXUS 5X API 29)中运行 react-native 应用程序。

When I run react-native run-android当我运行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我的 SDK 位置是正确的/home/user/Android-SDK

My .bashrc has these lines我的.bashrc有这些行

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-SDKlocal.properties在我的反应,原生的Android项目目录文件有sdk.dir=/home/user/Android-SDK

The SDK location is right in the android studio SDK manager as well. SDK 位置也在 android studio SDK 管理器中。

What should I do?我该怎么办?

It was a problem with adb ,fixed it with adb kill-server then adb root .这是 adb 的问题,用adb kill-server然后adb root修复它。 solution link解决方案链接

Also for some reason react-native run-android didn't work react-native start worked.同样由于某种原因react-native run-android不起作用react-native start起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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