build(android): pin Gradle JVM to JDK 21
System default is openjdk 25, whose version string the Kotlin compiler
bundled by AGP cannot parse — IllegalArgumentException: 25.0.2 from
org.jetbrains.kotlin.com.intellij.util.lang.JavaVersion.parse. Pin
org.gradle.java.home to the brew JDK 21 install (LTS, supported).
| .. | .. |
|---|
| 1 | 1 | org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError |
|---|
| 2 | 2 | android.useAndroidX=true |
|---|
| 3 | +# System default Java is 25 — the Kotlin compiler bundled by AGP can't parse |
|---|
| 4 | +# that version string yet ("IllegalArgumentException: 25.0.2"). Pin Gradle to |
|---|
| 5 | +# Java 21 (LTS, fully supported). |
|---|
| 6 | +org.gradle.java.home=/opt/homebrew/Cellar/openjdk@21/21.0.11/libexec/openjdk.jdk/Contents/Home |
|---|