fix: restore Java 17 bytecode target for the published library (fixes #236)#239
Open
tjelite1986 wants to merge 1 commit into
Open
fix: restore Java 17 bytecode target for the published library (fixes #236)#239tjelite1986 wants to merge 1 commit into
tjelite1986 wants to merge 1 commit into
Conversation
5.1.1 was published with jvmToolchain(21), so the AAR contains Java 21 class files (major version 65). Consumers building with JDK 17 fail with "class file has wrong version 65.0, should be 61.0" (issue tommybuonomo#236). Restore jvmToolchain(17) as in 5.1.0 and add a CI step that fails the build if the release AAR ever contains class files newer than Java 17. Fixes tommybuonomo#236
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
5.1.1 ships Java 21 class files. Consumers building with JDK 17 — still the default in a very large share of Android projects — fail with:
Reported in #236.
Root cause
Between 5.1.0 and 5.1.1,
viewpagerdotsindicator/build.gradle.ktschangedjvmToolchain(17)→jvmToolchain(21), which bumped the bytecode target of the published AAR. Verified against the published artifacts on Maven Central (class file major version, bytes 6–7):Fix
jvmToolchain(17)for the library module (the sample app is untouched — it is not published).assembleReleasethat inspects every class file in the release AAR and fails the build if any of them targets bytecode newer than Java 17, so this can't regress silently again.Verification
CI run on my fork with this change: Build & Lint green, and the new guard step reports
Highest class file major version in AAR: 61 (Java 17)— https://github.com/tjelite1986/dotsindicator/actions/runs/29317373777(The Dependency Review job failure there is fork-specific — Dependency Graph is disabled on forks.)
A patch release (5.1.2) with this fix would unblock everyone currently pinned to 5.1.0.
🤖 Generated with Claude Code