-1

I can't seem to understand why JitPack is failing to build my library, when I check the build log I find these errors and warnings:

An exception occurred applying plugin request [id: 'com.android.application'] > Failed to apply plugin 'com.android.internal.application'. > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. WARNING: Gradle 'install' task not found. Please add the 'maven' or 'android-maven' plugin. 

I tried to solve the Java version error by following the suggestions in this StackOverflow answer but it didn't do anything.

What am I doing wrong and how do I fix it?

8
  • 1
    You need to tell Jitpack which Java version to use, see also stackoverflow.com/q/68609683/534471 Commented Oct 16, 2021 at 18:22
  • @EmanuelMoecklin Thanks the java version error seems to have been fixed, but now it complains about Failed to apply plugin 'com.github.dcendents.android-maven'. log Commented Oct 16, 2021 at 18:31
  • I don't see you configuring the maven plugin or even using it. Jitpack can't publish something if there's no maven plugin/configuration (see also jitpack.io/docs/ANDROID). Maybe my article helps: medium.com/nerd-for-tech/… (although you can skip a lot and only do the maven plugin config part). Commented Oct 16, 2021 at 18:36
  • The important part is really this: developer.android.com/studio/build/maven-publish-plugin. If you have that, Jitpack will be able to build and publish. Commented Oct 16, 2021 at 18:40
  • Sorry but I am really confused, how do i configure maven plugin? I just tried to add classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' to my root build.gradle but it didn't change anything. This is the first time I publish a library, any help would be great. Commented Oct 16, 2021 at 18:45

1 Answer 1

0

Change the JAVA version to 11 from the settings :

enter image description here

Sign up to request clarification or add additional context in comments.

5 Comments

I already done that, it didn't work. Check the .idea/gradle.xml in my repo.
Jitpack doesn't build locally, .idea/gradle.xml is just an IDE setting and will be ignored by any build pipeline
@razz I just build your repo successfully. Also, run the app as well. perfectly working fine for me.
try to remove .idea and build folder and try again.
@MEETPrajapati the question is not about building locally, it's about building with jitpack.io

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.