Skip to content

[Requirement] Upgrade AGP 8.x and JDK 17 #72

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

Closed
Break4ever opened this issue Apr 17, 2023 · 2 comments
Closed

[Requirement] Upgrade AGP 8.x and JDK 17 #72

Break4ever opened this issue Apr 17, 2023 · 2 comments
Assignees
Labels

Comments

@Break4ever
Copy link

Break4ever commented Apr 17, 2023

  • What went wrong:
    A problem occurred evaluating project ':app'.

Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
Your current JDK is located in /usr/lib/jvm/java-11-openjdk-amd64
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.

I am using 'gradlew wrapper' change version to 8.1
but base on some reasons I don't have permission to control our team Jenkins CI such as build args so that I can not type '--build-arg JDK_VERSION=17'

And I think it's time to upgrade your base image because start in AGP 8.x.x, minimum JDK is 17, and you could also upgrade Kotlin version to 1.8.x

I know above requirement upgrading for you seems like period routine, but your image really helps me a lot.

Thanks @thyrlian

@Break4ever
Copy link
Author

Break4ever commented Apr 20, 2023

Currently in my Jenkins CI phase, the following script is my workaround:

sh "apt-get update -y"
sh "apt install openjdk-17-jdk -y"
sh "./gradlew wrapper --distribution-type=ALL --gradle-version=8.1 -Dorg.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64 <build-your-app-args>

Although above script is worked, but seems like spend a lot of times for initial apt update and install JDK 17 when trigger CI every time

Please upgrade your base image.

Thanks

@thyrlian
Copy link
Owner

Hi @Break4ever, thank you for using the image.

Regarding your concern, there are two folds:

  • It's time to upgrade JDK to 17, as you said, AGP 8.0.0 requires JDK 17. Furthermore, even Android Studio is now bundled with JDK 17 by default.
  • However, this Docker image doesn't have many variants. Besides the legal issue, it's not feasible to consider or support infinite combinations of various software/package versions (Android SDK, JDK, Gradle and etc.). That's why we tried to leave the freedom to the users to decide. Thus, for other similar requests (to upgrade xyz versions), the user can simply fork the Docker base image and apply their own needs.

I'm going to merge this PR, so your requirement is fulfilled. I'll do a few more things and then publish the image.

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants