【问题标题】:Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8(react-native Android)Android Gradle 插件需要 Java 11 才能运行。您当前使用的是 Java 1.8(react-native Android)
【发布时间】:2022-01-17 16:04:01
【问题描述】:

我将我的 gradle 版本从 4.x 升级到 7.x,

buildscript {
    ext {
        ...
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:7.0.2')
        ...
    }
}

然后开始面临以下问题:

* Where:
Build file '/var/lib/jenkins/workspace/TradeApp/node_modules/@react-native-async-storage/async-storage/android/build.gradle' line: 72

* What went wrong:
A problem occurred evaluating project ':@react-native-community_async-storage'.
> Failed to apply plugin 'com.android.internal.library'.
   > 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`.

如果有人可以帮助解决此问题而不是解决方法,我将不胜感激(降级回 4.x 可行,但我想知道为什么它不适用于 7.x)

【问题讨论】:

标签: android react-native gradle


【解决方案1】:

您可以在此处更改 Java 版本:

【讨论】:

    猜你喜欢
    • 2022-01-21
    • 2021-10-07
    • 2022-06-17
    • 2021-07-21
    • 2021-07-02
    • 2022-08-08
    • 1970-01-01
    • 2021-10-14
    • 2022-06-17
    相关资源
    最近更新 更多