From d757bd27ac7dbd53db3bc8b911a3ea56c907288a Mon Sep 17 00:00:00 2001 From: Claude Code Bot Date: Mon, 19 Oct 2026 14:40:15 -0700 Subject: [PATCH 1/2] fix(casks): install temurin@17 instead of the newest Temurin The unversioned temurin cask now installs JDK 27. React Native's Gradle plugin sets jvmToolchain(17) on every Android module, and Expo pins KSP to 17, so a build host without JDK 17 fails at compileDebugJavaWithJavac. Newer JDKs do not substitute: on 24+, Prefab's JNA call prints a JEP 472 warning that AGP 8.12 treats as a fatal error. Verified on MIMOLETTE with RN 0.86.3 / Expo 57 / AGP 8.12.0. --- SPEC.md | 4 ++-- app-setup/android-setup.sh | 4 ++-- config/casks.txt | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/SPEC.md b/SPEC.md index 2da3cdd..9d1b2ec 100644 --- a/SPEC.md +++ b/SPEC.md @@ -170,8 +170,8 @@ node yarn pnpm -# Java (for Android/Gradle) -temurin +# Java (for Android/Gradle; React Native pins a JDK 17 toolchain) +temurin@17 # Python (for various tooling) python@3.12 diff --git a/app-setup/android-setup.sh b/app-setup/android-setup.sh index 5c50e30..c365cad 100755 --- a/app-setup/android-setup.sh +++ b/app-setup/android-setup.sh @@ -8,7 +8,7 @@ # # Prerequisites: # - android-commandlinetools installed via Homebrew -# - Java (temurin) installed via Homebrew +# - Java 17 (temurin@17) installed via Homebrew # # Usage: ./android-setup.sh [--force] # --force: Skip confirmation prompts @@ -134,7 +134,7 @@ main() { # Verify Java is available section "Verifying Java Installation" if ! command -v java &>/dev/null; then - collect_error "Java not found - install temurin via Homebrew first (check formulae.txt)" + collect_error "Java not found - install temurin@17 via Homebrew first (check casks.txt)" exit 1 fi diff --git a/config/casks.txt b/config/casks.txt index 431fc34..5d8b9f9 100644 --- a/config/casks.txt +++ b/config/casks.txt @@ -1,7 +1,9 @@ # Development android-studio android-commandlinetools -temurin +# React Native compiles every Android module with a JDK 17 toolchain +# (jvmToolchain(17) in its Gradle plugin), so 17 must be installed. +temurin@17 # Terminal iterm2 From a87dca7f1c921366ecd4ac85fd87b252adb45364 Mon Sep 17 00:00:00 2001 From: Claude Code Bot Date: Mon, 19 Oct 2026 14:41:05 -0700 Subject: [PATCH 2/2] fix(android-setup): require JDK 17, not just any java on PATH `command -v java` passes on a host that has only JDK 27, which then fails later at compileDebugJavaWithJavac. Check with `java_home --failfast -v 17` instead; --failfast makes java_home exit non-zero when 17 is absent rather than returning the newest JDK. --- app-setup/android-setup.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app-setup/android-setup.sh b/app-setup/android-setup.sh index c365cad..2685bae 100755 --- a/app-setup/android-setup.sh +++ b/app-setup/android-setup.sh @@ -133,14 +133,16 @@ main() { # Verify Java is available section "Verifying Java Installation" - if ! command -v java &>/dev/null; then - collect_error "Java not found - install temurin@17 via Homebrew first (check casks.txt)" + # --failfast: without it, java_home returns the newest JDK, exit 0, when no 17 is installed. + local java17_home + if ! java17_home="$(/usr/libexec/java_home --failfast -v 17 2>/dev/null)"; then + collect_error "JDK 17 not found - install temurin@17 via Homebrew first (check casks.txt)" exit 1 fi local java_version - java_version="$(java -version 2>&1 | head -n 1)" - show_log "Java: ${java_version}" + java_version="$("${java17_home}/bin/java" -version 2>&1 | head -n 1)" + show_log "Java 17: ${java_version} (${java17_home})" # Determine ANDROID_HOME section "Configuring ANDROID_HOME"