React-native并且它不起作用,指责一些错误“在项目':app'中找不到任务'installRelease'" [英] React-native and it dont work, accusing some error "Task 'installRelease' not found in project ':app'"

查看:71
本文介绍了React-native并且它不起作用,指责一些错误“在项目':app'中找不到任务'installRelease'"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个问题,做了很多研究,但没有答案对我有用.因此:Windows 10Android Studio版本:最新版本React-native版本:4.6.3

I have this problem and did a lot of research but none of answer worked for me. SO: Windows 10 Android Studio version: latest version React-native version: 4.6.3

错误:信息正在运行jetifier将库迁移到AndroidX.您可以使用"--no-jetifier"标志禁用它.Jetifier发现有960个文件需要正向喷射.使用4名工人...信息正在启动JS服务器...无法将"C:\ Users \ username \ AppData \ Local \ Android \ Sdk"识别为内部或外部命令,可操作的程序或批处理文件.信息正在启动模拟器...错误无法启动模拟器.原因:未找到任何仿真器作为 emulator -list-avds 的输出.警告请手动启动仿真器或连接设备.否则,应用程序可能无法启动.信息正在安装该应用程序...

ERROR: info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 960 file(s) to forward-jetify. Using 4 workers... info Starting JS server... 'C:\Users\username\AppData\Local\Android\Sdk' is not recognized as an internal or external command, operable program or batch file. info Launching emulator... error Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds. warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch. info Installing the app...

在此版本中使用了不推荐使用的Gradle功能,使其与Gradle 7.0不兼容.使用"--warning-mode all"来显示各个弃用警告.参见 https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

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

失败:构建失败,并出现异常.

FAILURE: Build failed with an exception.

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

  • What went wrong: Task 'installDebug' not found in project ':app'.

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

Try: Run gradlew tasks to get a list of available tasks. 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.

https://help.gradle.org

2秒内失败

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

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

失败:构建失败,并出现异常.

FAILURE: Build failed with an exception.

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

  • What went wrong: Task 'installDebug' not found in project ':app'.

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

Try: Run gradlew tasks to get a list of available tasks. 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.

https://help.gradle.org

2秒内失败

推荐答案

好,我解决了这个问题,我将其发布以帮助将来的某人.为了解决这个问题,我使用Android Studio在项目上打开 android 文件夹,并安装了所有缺少的依赖项和文件.

OK, i solved it, im postting this to help someone in the future. To solve it I used Android Studio to Open the folder android on the project and it install all missing dependecies and files.

这篇关于React-native并且它不起作用,指责一些错误“在项目':app'中找不到任务'installRelease'"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆