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
你能帮我吗?
答
问题是 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.