【问题标题】:react-native run-android not detecting emulator or devicereact-native run-android 未检测到模拟器或设备
【发布时间】:2021-07-20 22:39:47
【问题描述】:

当我运行 react-native run-android 来运行我的 React Native 应用程序时,我收到此错误,然后构建失败:

'C:\Users\Alex\AppData\Local\Android\Sdk/platform-tools/adb' is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Emulator exited before boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.

无论我是使用通过 USB 连接的手机运行命令,还是使用从 Android Studio 打开的模拟器运行命令,我都会收到此错误。但是,当我运行adb devices 时,模拟器和我的设备都会出现。 我很确定这不是 React Native 代码的问题,因为我尝试运行多个不同的应用程序并得到相同的错误。

有谁知道可能是什么问题以及为什么没有检测到设备和模拟器?

【问题讨论】:

  • 能否请您发布react-native info的输出

标签: android react-native react-native-android


【解决方案1】:

问题是我电脑的杀毒软件已经删除了 adb.exe,所以当我重新安装包含 adb.exe 的平台工具文件夹后,react-native run-android 正常工作,并且检测到我连接的设备。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-06-27
    • 1970-01-01
    • 2011-11-27
    • 2021-06-11
    • 2019-11-29
    • 2017-04-02
    • 1970-01-01
    相关资源
    最近更新 更多