Build Failed:React-Native

问题描述 投票:0回答:1

错误无法安装应用程序。确保您拥有Android 开发环境搭建: https://reactnative.dev/docs/environment-setup。使用--verbose运行CLI 标记以获取更多详细信息。错误:命令失败:./ gradlew app:installDebug -PreactNativeDevServerPort = 8081

FAILURE:构建因异常而失败。

  • 出了什么问题:在项目':app'中找不到任务'installDebug'。

  • 尝试:运行gradlew任务以获取可用任务的列表。使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获取完整的见解。

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

6秒内失败

at makeError (/home/te3t0/Desktop/testpro/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/home/te3t0/Desktop/testpro/node_modules/execa/index.js:278:16)
at process._tickCallback (internal/process/next_tick.js:68:7)

MY OS = UbuntuIDE = Android Studioreact-native信息

系统:

    OS: Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i3-3110M CPU @ 2.40GHz
    Memory: 407.84 MB / 9.60 GB
    Shell: 5.0.16 - /bin/bash

二进制文件:

    Node: 10.19.0 - /usr/bin/node
    Yarn: Not Found
    npm: 6.14.4 - /usr/bin/npm
    Watchman: Not Found

SDK:

    Android SDK: Not Found

IDE:

    Android Studio: Not Found

语言:

    Java: 1.8.0_252 - /usr/bin/javac
    Python: Not Found

npmPackages:

    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.2 => 0.62.2 

npmGlobalPackages:

    *react-native*: Not Found

react-native gradle react-native-android
1个回答
0
投票

您需要安装Android SDK和Android Studio并配置ANDROID_HOME环境变量。参考:https://reactnative.dev/docs/environment-setup

© www.soinside.com 2019 - 2024. All rights reserved.