-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. #4772
Comments
+1 |
@gregko Please do the below 2 steps. First, change JAVA8 from your build.gradle(app module) file to 11 like below compileOptions { Secondly, add a file in the root folder of your project- jdk:
Please read above line as below. These two steps will solve the problem that you are facing. This happens because of the gradle build tools version. |
Thank you, did this, but now the build on jitpack fails with message:
Configure project :
Gradle version Gradle 7.0.2
FAILURE: Build failed with an exception.
* Where:
Script '/script/maven-plugin.gradle' line: 2
* What went wrong:
A problem occurred evaluating script.
Failed to apply plugin 'com.github.dcendents.android-maven'.
Could not create plugin of type 'AndroidMavenPlugin'.
Could not generate a decorated class for type AndroidMavenPlugin.
org/gradle/api/publication/maven/internal/MavenPomMetaInfoProvider
No idea what’s going on there.
Greg
From: Vipinbalakrishnan ***@***.***) ***@***.***
Sent: Saturday, October 9, 2021 10:27 AM
To: jitpack/jitpack.io
Cc: Greg Kochaniak; Mention
Subject: Re: [jitpack/jitpack.io] Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. (#4772)
@gregko <https://github.com/gregko> Please do the below 2 steps.
First, change JAVA8 from your build.gradle(app module) file to 11 like below
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
Secondly, add a file in the root folder of your project-
-named jitpack.yml file with the following content.
jdk:
* openjdk11
These two steps will solve the problem that you are facing.
This happens because of the gradle build tools version.
Latest versions requires Java 11.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#4772 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AANKO7EWWCZLO4UN3OKBWHLUGBGL7ANCNFSM5FO3DBMA> .
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> . <https://github.com/notifications/beacon/AANKO7CSEH4LTUKUYEQ2HD3UGBGL7A5CNFSM5FO3DBMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOG76KXYA.gif>
|
For the error that mentioned as configure project, use the latest dependencies { Please check the below steps that are necessary to publish a library to jitpack.io Omit the ones related to java 11 as you have already did those.
maven { url "https://jitpack.io" } 2. Added plugin maven-publish in the build.gradle file of the module as below along with library plugin. plugins { 3.Added jitpack.yml in the root of the project for JAVA 11 support As below jdk:
4.Change java version to 11 in build.gradle file of the app module and library module inside android {} as below compileOptions { 5.Add maven publication settings as below in the build.gradle of module afterEvaluate { |
Thank you for your help! Looks like it worked.
From: Vipinbalakrishnan ***@***.***) ***@***.***
Sent: Wednesday, October 20, 2021 3:28 AM
To: jitpack/jitpack.io
Cc: Greg Kochaniak; Mention
Subject: Re: [jitpack/jitpack.io] Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. (#4772)
@gregko <https://github.com/gregko>
For the current issue, you need to specify the maven plugin and
* 'afterEvaluate' section in build.gradle file of your module.
Please check the below steps that are necessary to publish a library to jitpack.io
Omit the ones related to java 11 as you have already did those.
1. Added jitpack.io to build.gradle file of the root of the project ad below.
maven { url "https://jitpack.io" }
2. Added plugin maven-publish in the build.gradle file of the module as below along with library plugin.
plugins {
id 'com.android.library'
id 'maven-publish'
}
3.Added jitpack.yml in the root of the project for JAVA 11 support
As below
jdk:
* openjdk11
4.Change java version to 11 in build.gradle file of the app module and library module inside android {} as below
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
5.Add maven publication settings as below in the build.gradle of module
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
from components.release
groupId = 'com.github.yourgitid'
artifactId = 'your-repository'
version = 'x.x'
}
}
}
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#4772 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AANKO7FXVQCNPAXPQXXMNQDUHZVRZANCNFSM5FO3DBMA> .
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> . <https://github.com/notifications/beacon/AANKO7CJ3AJ5NYZFSNW6KNDUHZVRZA5CNFSM5FO3DBMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHB4DJII.gif>
|
Glad that it helped you. Please close the issue if it is worked. Thank you. |
Useful, I had the same problem the solution provided resolved it:
Code Changes Build / Logs Thank you. |
FAILURE: Build failed with an exception.
Where:
Build file '/home/jitpack/build/app/build.gradle' line: 2
What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
Please provide:
Link to build log from https://jitpack.io
https://jitpack.io/com/github/gregko/Mini-WebDAV-server-for-Android/1.6.3/build.log
Does the project build on your machine with the same commands (e.g. ./gradlew install) ?
Yes
What error are you seeing?
" Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8."
Thank you!
The text was updated successfully, but these errors were encountered: