-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?

razz
  • 9,770
  • 7
  • 50
  • 68
  • 1
    You need to tell Jitpack which Java version to use, see also https://stackoverflow.com/q/68609683/534471 – Emanuel Moecklin Oct 16 '21 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](https://jitpack.io/com/github/arcm111/ScaleNumberPicker/main-ecadbebf17-1/build.log) – razz Oct 16 '21 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 https://jitpack.io/docs/ANDROID/). Maybe my article helps: https://medium.com/nerd-for-tech/oh-no-another-publishing-android-artifacts-to-maven-central-guide-9d7f300ebd74 (although you can skip a lot and only do the maven plugin config part). – Emanuel Moecklin Oct 16 '21 at 18:36
  • The important part is really this: https://developer.android.com/studio/build/maven-publish-plugin. If you have that, Jitpack will be able to build and publish. – Emanuel Moecklin Oct 16 '21 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. – razz Oct 16 '21 at 18:45
  • Please read the articles I mention above, https://developer.android.com/studio/build/maven-publish-plugin is probably the one you want since it focuses on the exact thing you need to do – Emanuel Moecklin Oct 16 '21 at 18:48
  • https://www.jitpack.io/com/github/arcm111/ScaleNumberPicker/1.0.0/ScaleNumberPicker-1.0.0.pom This is the path where the studio is looking for the lib. but jitpack returns nothing. – Meet Prajapati Oct 16 '21 at 19:01
  • because nothing has been published yet, once you configure the maven plugin you need to create a release or tag a commit, see documentation: "If everything went well in the previous step, your library is ready to be released! Create a GitHub release or add a git tag and you’re done!" (https://jitpack.io/docs/ANDROID/) – Emanuel Moecklin Oct 16 '21 at 19:23

1 Answers1

0

Change the JAVA version to 11 from the settings :

enter image description here

Meet Prajapati
  • 416
  • 5
  • 9