Android Gradle 插件需要 Java 11 才能运行.您当前使用的是 Java 1.8.错误 [英] Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. Error

查看:1236
本文介绍了Android Gradle 插件需要 Java 11 才能运行.您当前使用的是 Java 1.8.错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 Jitpackio 发布一个库.当我发布库时,出现以下错误;

I want to publish a library with Jitpackio. When I publish the library I get the following error;

"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`."

Gradle 版本:7.0.2

我的 Gradle JDK 版本

你能帮我吗?

推荐答案

问题是 JitPack.io 单独运行 JDK1.8.在项目文件中添加一个 jitpack.yml 文件,内容如下:

The problem was that JitPack.io was running with JDK1.8 on its own. Add a jitpack.yml file to the project file with this content:

jdk:
  - openjdk11

当我这样做时,问题就消失了.

When I did that the problem went away.

这篇关于Android Gradle 插件需要 Java 11 才能运行.您当前使用的是 Java 1.8.错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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