我的控制台出现以下错误。
失败:构建完成但有 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/