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 Version : 7.0.2
Can you help me?
5
Answers
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:When I did that the problem went away.
According to AGP release note here
JDK 11 is required if you using AGP 7.0.
You can modify AS JDK version like below (Only effect run app build project in AS small hammer or run action) if Android Studio Arctic Fox | 2020.3.1 you use .
For some one building android app with AGP 7.0 with command line
solution in reviewed in jitpack github page:
here
as said :
you should create a file in root of project named
jitpack.yml contain
then change build.gradle file in library as :
}
Create
jitpack.yml
in root project dir.It’s working for me.
Only add jitpack.yml isn’t working for me in gradle 7.0.2, but change gradle jdk works, according to this blog