android - react-native run-android 失败并出现错误

标签 android android-studio react-native

getting the following errors when running the command: <code>react-native run-android</code>

我的控制台出现以下错误。

失败:构建完成但有 2 次失败。

1:任务因异常而失败。

  • 出了什么问题: 任务 ':react-native-video:compileDebugJavaWithJavac' 执行失败。

    Compilation failed; see the compiler error output for details.

  • 尝试:

    使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。使用 --scan 运行以获得完整的见解。

2:任务因异常而失败。

  • 出了什么问题: 任务 ':react-native-firebase:compileDebugJavaWithJavac' 执行失败。

    Compilation failed; see the compiler error output for details.

  • 尝试:

    使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。使用 --scan 运行以获得完整的见解。

  • https://help.gradle.org 获得更多帮助

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 10s 151 actionable tasks: 13 executed, 138 up-to-date error 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 error Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details.

最佳答案

您的安卓设备是否已连接。用

检查
adb devices

如果此时没有显示设备名称,说明没有连接设备,请尝试正确连接设备并运行

react-native run-android

并在不同的终端运行

npm start

关于android - react-native run-android 失败并出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58833335/

相关文章:

android - 明确的 Intent 错误

android - 如何在 MainActivity 的 onCreate 函数中获取当前的 ReactContext?

android - 在android中使用bundle传递数组

php - 优化 foreach() 中的 SQL 查询

android - FLAG_KEEP_SCREEN_ON 反向工作

android - 如何在不重复自己的情况下在子项目中拥有相同的依赖关系?

java - 如何允许用户将图像上传到我的应用程序并使用它们?

java - 检测动画何时完成

twitter - 如何在 React Native 中使用 Firebase Twitter 身份验证?

react-native - 如何使用 useState Hook 来处理来自 React Native 中 FlatList 的多个动态文本输入?