Open
Conversation
Gradle 8.9's embedded Kotlin compiler cannot parse Java 25 version strings, and GraalVM 25's jlink is incompatible with Android's core-for-system-modules.jar. Upgrade to Gradle 9.1.0 + AGP 9.0.1 + Kotlin 2.2.10 and use JDK 21 toolchain for compilation.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Android build configuration to support building with Java 25 by upgrading the Gradle/Android toolchain and adjusting Kotlin/JVM settings.
Changes:
- Upgrade Gradle wrapper to 9.1.0 and bump AGP/Kotlin/KSP versions via the version catalog.
- Adjust Android module configuration: compileSdk bump and move from deprecated
kotlinOptionsto a JVM toolchain. - Add
android.disallowKotlinSourceSets=falseto maintain KSP compatibility with newer AGP.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| android/gradle/wrapper/gradle-wrapper.properties | Bumps Gradle wrapper distribution to 9.1.0. |
| android/gradle/libs.versions.toml | Updates AGP/Kotlin/KSP versions and modifies plugin entries. |
| android/gradle.properties | Adds an Android Gradle property needed for KSP/AGP compatibility. |
| android/build.gradle.kts | Updates the root plugin alias declarations. |
| android/app/build.gradle.kts | Updates app module plugins and Android/Kotlin/JVM compilation configuration. |
You can also share your feedback on Copilot code review. Take the survey.
| @@ -1,13 +1,12 @@ | |||
| plugins { | |||
| alias(libs.plugins.android.application) | |||
| @@ -42,6 +42,5 @@ play-services-location = { group = "com.google.android.gms", name = "play-servic | |||
|
|
|||
| [plugins] | |||
| android-application = { id = "com.android.application", version.ref = "agp" } | |||
| @@ -1,6 +1,5 @@ | |||
| plugins { | |||
| alias(libs.plugins.android.application) apply false | |||
Comment on lines
30
to
37
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
| sourceCompatibility = JavaVersion.VERSION_21 | ||
| targetCompatibility = JavaVersion.VERSION_21 | ||
| } | ||
|
|
||
| kotlinOptions { | ||
| jvmTarget = "17" | ||
| kotlin { | ||
| jvmToolchain(21) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kotlin-androidplugin (AGP 9 has built-in Kotlin)kotlinOptionswithjvmToolchain(21)and bump compileSdk to 36android.disallowKotlinSourceSets=falsefor KSP compatibility with AGP 9Context
The build was failing with the cryptic error
25.0.2because Gradle 8.9's embedded Kotlin compiler couldn't parse the Java 25 version string. GraalVM 25'sjlinkalso has a missingjdk.internal.vm.cimodule that breaks Android's JDK image transform, so a JDK 21 toolchain is used for compilation.Test plan
./gradlew assembleDebugbuilds successfully