Android: build on JDK 25 with Gradle 9.6.1, AGP 9.4.1, Kotlin 2.2.10

Android Studio now bundles JBR 25, which Gradle 8.14's embedded Kotlin
can't parse. Follow Tauri's current template: Gradle 9.6.1, Kotlin 2.2.10,
the builtInKotlin/newDsl/failOnMissingFiles compatibility flags, the
compilerOptions DSL, and ExecOperations in BuildTask (project.exec is gone
in Gradle 9). AGP goes to 9.4.1 rather than the template's 9.3.1.

Release lint vital is turned off: AGP 9.3/9.4's lint crashes analysing the
.gradle.kts scripts (findFirCompiledSymbol), failing every release build.

The env scripts now accept JDK 17 through 25, preferring Studio's JBR.
This commit is contained in:
2026-10-16 22:39:36 -05:00
parent 89378a41fb
commit 1641d9aa47
10 changed files with 96 additions and 61 deletions

View File

@@ -474,10 +474,10 @@ prints the three environment variables to export (`ANDROID_HOME`, `NDK_HOME`,
> Android's system libsqlite3 either — the card schema needs FTS5 with the
> `trigram` tokenizer, which platform SQLite often lacks.
> **Why `JAVA_HOME`?** Gradle/AGP reject very new JDKs. The script uses
> Android Studio's bundled JetBrains Runtime when it's JDK 21 or 17, but recent
> Studio releases bundle JDK 25 and Fedora 44 no longer packages 21, so you may
> need `sudo dnf install temurin-21-jdk` (from the Adoptium repo).
> **Why `JAVA_HOME`?** The Android build (Gradle 9.6, AGP 9) runs on JDK 17
> through 25. The script prefers Android Studio's bundled JetBrains Runtime,
> then the newest system JDK in that range, and skips anything newer than 25
> until it's been tested.
### Build and run