无法运行反应

发布于 2025-02-12 11:27:23 字数 1437 浏览 1 评论 0原文

在运行NPX反应式运行android这是终端的消息:

失败:构建失败而异常。

  • 其中: 构建文件'/users/vivek/documents/code-here/react-native/instaclone/android/anp/app/build.gradle'line:1

  • 出了什么问题: 评估项目“:app”的问题。

无法应用插件'com.android.internal.application'。 Android Gradle插件需要Java 11运行。您目前正在使用Java 1.8。 您可以尝试以下一些选项: - 更改IDE设置。 - 更改Java_home环境变量。 - 更改org.gradle.java.home in gradle.properties

  • 尝试:

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

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

。 Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup 。 错误:命令失败:./gradlew App:installdebug -preactnativevserverport = 8081

故障:构建失败而异常。

  • 其中: 构建文件'/users/vivek/documents/code-here/react-native/instaclone/android/anp/app/build.gradle'line:1

  • 出了什么问题: 评估项目“:app”的问题。

无法应用插件'com.android.internal.application'。 Android Gradle插件需要Java 11运行。您目前正在使用Java 1.8。 您可以尝试以下一些选项: - 更改IDE设置。 - 更改Java_home环境变量。 - 更改org.gradle.java.home in gradle.properties

After running npx react-native run-android here is the message from terminal:

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/vivek/Documents/Code-Here/React-Native/instaClone/android/app/build.gradle' line: 1

  • What went wrong:
    A problem occurred evaluating project ':app'.

Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing org.gradle.java.home in gradle.properties.

  • Try:

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.

BUILD FAILED in 7s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/vivek/Documents/Code-Here/React-Native/instaClone/android/app/build.gradle' line: 1

  • What went wrong:
    A problem occurred evaluating project ':app'.

Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing org.gradle.java.home in gradle.properties.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

捎一片雪花 2025-02-19 11:27:24

请务必始终仔细阅读错误消息,因为它可能会告诉您出了什么问题以及如何修复它!

在这种情况下,错误是告诉您系统上没有安装的Java的正确版本。 React Native用来创建本机Android构建的Gradle需要在系统上安装Java 11,而您只有1.8版。

这意味着您需要安装最新的JDK,您可以通过遵循 react react Arect Andive Antival环境来做到这一点。设置有关特定操作系统的Android的说明。

Be sure to always read the error message carefully, because it will likely tell you what is wrong and how you can fix it!

In this case, the error is telling you that you don't have the correct version of Java installed on your system. Gradle, which React Native uses to create a native Android build, requires Java 11 to be installed on your system, whereas you only have version 1.8.

This means you need to install an up-to-date JDK, which you can do by following the React Native Environment Setup instructions for Android for your specific operation system.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文