React native 任务';的执行失败:应用程序:installDebug';大多数时候

React native 任务';的执行失败:应用程序:installDebug';大多数时候,react-native,React Native,网上有不少关于这个错误的帖子。我的情况是,我有时可以建立连接,但大多数时候失败了。以下是失败时的错误: PS C:\d\code\js\chatapp> react-native run-android JS server already running. Building and installing the app on the device (cd android && gradlew.bat installDebug)... Starting a Gradle Da

网上有不少关于这个错误的帖子。我的情况是,我有时可以建立连接,但大多数时候失败了。以下是失败时的错误:

PS C:\d\code\js\chatapp> react-native run-android
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 15s
27 actionable tasks: 1 executed, 26 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
以下是成功时的信息:

PS C:\d\code\js\chatapp> react-native run-android
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...

> Task :app:installDebug
Installing APK 'app-debug.apk' on 'MHA-L29 - 8.0.0' for app:debug
Installed on 1 device.


BUILD SUCCESSFUL in 6s
27 actionable tasks: 1 executed, 26 up-to-date
'adb' is not recognized as an internal or external command,
operable program or batch file.
Starting the app (c:\AppData\Local\Android\Sdk/platform-tools/adb shell am start -n com.chatapp/com.chatapp.MainActivity...
Starting: Intent { cmp=com.chatapp/.MainActivity }

我没有很好的解释为什么有时它能工作,而另一些时候它不能。在每次
react native run andrioid
之前,Mate 9上的
USB调试
已启用。

当我连接的手机屏幕锁定时,这种情况也会发生在我身上。当您尝试跑步时,请确保手机处于“活动”状态。在运行react native run android之前,您可以使用“adb设备”命令列出所有连接的设备。确保一次只有一个模拟器(也没有运行模拟器)。
我最不推荐的是更新React Native。他们在每一个版本上都做了很好的改进,在最新的版本中你可能再也看不到这个错误了。祝你好运

当我连接的手机屏幕被锁定时,这种情况也会发生在我身上。当您尝试跑步时,请确保手机处于“活动”状态。在运行react native run android之前,您可以使用“adb设备”命令列出所有连接的设备。确保一次只有一个模拟器(也没有运行模拟器)。
我最不推荐的是更新React Native。他们在每一个版本上都做了很好的改进,在最新的版本中你可能再也看不到这个错误了。祝你好运

我有一个类似的问题,刚刚在这里发布了一个对我有用的解决方案-

我遇到了一个类似的问题,不确定你是否能修复它,但我在寻找解决方案时偶然看到了这篇文章,上面的解决方案对我来说不起作用

我发现的一个解决方案是安装、启动它,而不是从Android Studio内部启动模拟器。这几乎是令人恼火的一件事,事实证明解决起来是多么简单


在尝试了12个多小时的不同解决方案后,看到构建成功真是太好了。

我遇到了类似的问题,刚刚在这里发布了一个对我有效的解决方案-

我遇到了一个类似的问题,不确定你是否能修复它,但我在寻找解决方案时偶然看到了这篇文章,上面的解决方案对我来说不起作用

我发现的一个解决方案是安装、启动它,而不是从Android Studio内部启动模拟器。这几乎是令人恼火的一件事,事实证明解决起来是多么简单


在尝试了12个多小时的不同解决方案后,看到构建成功真是太好了。

我的项目遇到了这个问题。我已经尝试了很多方法来解决这个问题,我在stackoverflow、github和博客文章中有很多指导原则。但在这个过程中我犯了一个错误。因此,请确保您在调试期间做了一些事情

  • 运行
    cd-android&&./gradlew-clean&./gradlew:app:bundleRelease

  • 确保在每个操作中擦除emulator中的数据

  • 如果您正在尝试使用外部设备,请确保它处于联机状态或解锁屏幕


  • 我的项目有这个问题。我已经尝试了很多方法来解决这个问题,我在stackoverflow、github和博客文章中有很多指导原则。但在这个过程中我犯了一个错误。因此,请确保您在调试期间做了一些事情

  • 运行
    cd-android&&./gradlew-clean&./gradlew:app:bundleRelease

  • 确保在每个操作中擦除emulator中的数据

  • 如果您正在尝试使用外部设备,请确保它处于联机状态或解锁屏幕


  • 如果您的设备未正确连接,则可能会发生这种情况,但当我收到此错误时,我会通过检查以下条件来解决此问题:1:如果您正在使用USB调试。=>查看USB电缆是否正确连接2:如果您使用的是IP addredds=>则检查IP地址是否正确,以及设备和机器是否位于同一网络上。希望这能起作用。如果您的设备连接不正确,可能会发生这种情况,但当我收到此错误时,我会通过检查以下条件来解决它:1:如果您正在使用USB调试。=>查看USB电缆是否正确连接2:如果您使用的是IP addredds=>则检查IP地址是否正确,以及设备和机器是否位于同一网络上。希望这能奏效。