Skip to content

build: target JDK 17 for published library modules - #2

Merged
simonvar merged 3 commits into
mainfrom
fix/target-jdk-17
Jul 17, 2026
Merged

build: target JDK 17 for published library modules#2
simonvar merged 3 commits into
mainfrom
fix/target-jdk-17

Conversation

@simonvar

@simonvar simonvar commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Upstream's AGP 9 bump moved the toolchain to JDK 21, so 4.4.0-ws.1 ships class files v65. Consumers running Robolectric unit tests on a Java 17 JVM fail with UnsupportedClassVersionError and have to force a 21+ test JVM via toolchains.

Approach: the build and tests keep running on JDK 21 (Robolectric needs a 21 runtime for the newest Android SDK levels), but library and library-no-op now emit Java 17 bytecode: compileOptions source/target 17 + Kotlin jvmTarget = JVM_17.

Also bumps AGP 9.2.1 → 9.3.0 to fix the unrelated AndroidGradlePluginVersion lint error (warningsAsErrors) that started failing when 9.3.0 was released.

Verified locally: :library:testDebugUnitTest, assembleRelease, lintDebug pass; AAR class files are major version 61 (Java 17).

After merge: publish as v4.4.0-ws.2 (release tag drives the published version).

🤖 Generated with Claude Code

simonvar and others added 3 commits July 17, 2026 16:37
Consumers running unit tests on a Java 17 JVM (Robolectric) fail with
UnsupportedClassVersionError because upstream's AGP 9 bump moved the
toolchain to 21. Publish class files targeting 17 instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Robolectric tests exercise Android SDK levels that require a Java 21
runtime, so the toolchain stays at 21; javac and kotlinc emit 17.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fixes the AndroidGradlePluginVersion lint error (warningsAsErrors).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@simonvar
simonvar merged commit 191ed88 into main Jul 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant