From 8827e85136aacb67715c8f85b799cac447094b43 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 23 Oct 2026 14:02:32 +0200 Subject: [PATCH 1/2] build: Pin the Gradle daemon to JDK 21 Since #6242 the build needs JDK 21 to run Gradle. Daemon JVM criteria let Gradle pick an installed JDK 21 regardless of JAVA_HOME. Also write a heap dump on daemon OOM instead of crashing, and silence Gradle's welcome message and Android Studio's AGP upgrade prompt. Co-Authored-By: Claude Opus 5.5 (1M context) --- gradle.properties | 5 ++++- gradle/gradle-daemon-jvm.properties | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 gradle/gradle-daemon-jvm.properties diff --git a/gradle.properties b/gradle.properties index ed4c8eb9f8..0c98b24038 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,11 @@ # Daemons heap size -org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+CrashOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC +org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC org.gradle.caching=true org.gradle.parallel=true org.gradle.configureondemand=true org.gradle.configuration-cache=true org.gradle.configuration-cache.parallel=true +org.gradle.welcome=never org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled @@ -15,6 +16,8 @@ android.builtInKotlin=false android.newDsl=false android.experimental.lint.version=9.4.0 +android.disableAgpUpgradePrompt=true + # Release information versionName=8.61.1 diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties new file mode 100644 index 0000000000..52234b5ce8 --- /dev/null +++ b/gradle/gradle-daemon-jvm.properties @@ -0,0 +1 @@ +toolchainVersion=21 From dcb704ac36e7d3af1717a997efa0a88bd628c93f Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 23 Oct 2026 14:11:12 +0200 Subject: [PATCH 2/2] build: Drop the JDK 21 check now that the daemon JVM is pinned The daemon JVM criteria only accept JDK 21, so the check can't fail. CONTRIBUTING.md no longer claims a newer JDK runs the build. Co-Authored-By: Claude Opus 5.5 (1M context) --- CONTRIBUTING.md | 7 ++++--- build.gradle.kts | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8c49840c0b..79800a6ff2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,9 +36,10 @@ You are welcome to use whatever tools you prefer for making a contribution. Howe # Requirements -The project requires you to run JDK 21 or newer. Compilation and tests always happen on JDK 21 -through a [toolchain](https://docs.gradle.org/current/userguide/toolchains.html), so a newer JDK -runs the build but never changes its output. +The project requires JDK 21. Gradle finds it through +[toolchain auto-detection](https://docs.gradle.org/current/userguide/toolchains.html#sec:auto_detection) +(SDKMAN!, asdf, IntelliJ, ...) and uses it for the build, compilation and tests, whatever JDK +`JAVA_HOME` points to. ## Android diff --git a/build.gradle.kts b/build.gradle.kts index 898b429cb5..1dc5fb817f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,10 +29,6 @@ plugins { alias(libs.plugins.sentry) apply false } -check(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) { - "This build requires JDK 21 or newer, but runs on JDK ${JavaVersion.current()}." -} - buildscript { repositories { google()