Now using JDK 17.
New Android Gradle Plugin (8.0.0) requires JDK 17.
https://developer.android.com/build/releases/gradle-plugin#groovy
¡Necesito este cambio!
@jangrewe a very critical fix. After updating AGP to 8.0, the image stopped working with an error "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". When should we wait for the release with this fix?
Folks, I forked the project, applied this change and uploaded it to docker hub. You can now use image: martinsumera/gitlab-ci-android. Seems like that it works fine for me.
I have added installation of both java 11 and java 17 to docker. Reason for this is that even though gradle requires java 17 for it's own internal purposes, Kotlin has some issues with java 17 compatibility. So I needed to install both versions and make project compatible with java 11.
android {
...
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
}
}
kotlin {
jvmToolchain(11)
}
I also needed to setup JAVA_HOME directly in the CI in order to get it work
default:
before_script:
- export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
Hope that it will help you.
Github project: https://github.com/SumeraMartin/gitlab-ci-android DockerHub project: https://hub.docker.com/repository/docker/martinsumera/gitlab-ci-android/general
@SumeraMartin I am getting unable to access 'https://gitlab.com/xxxxxx/xxxxxx.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none. Can you add the following in the docker image?
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates -y
sudo update-ca-certificates
@ravibpatel feel free to create MR to that repo
@SumeraMartin I think it won't be necessary. It seems image wasn't causing that issue after all.