Skip to content

fix: restore Java 17 bytecode target for the published library (fixes #236)#239

Open
tjelite1986 wants to merge 1 commit into
tommybuonomo:masterfrom
tjelite1986:fix/restore-jvm-target-17
Open

fix: restore Java 17 bytecode target for the published library (fixes #236)#239
tjelite1986 wants to merge 1 commit into
tommybuonomo:masterfrom
tjelite1986:fix/restore-jvm-target-17

Conversation

@tjelite1986

Copy link
Copy Markdown

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:

error: cannot access WormDotsIndicator
  bad class file: .../jetified-dotsindicator-5.1.1-api.jar(...WormDotsIndicator.class)
    class file has wrong version 65.0, should be 61.0

Reported in #236.

Root cause

Between 5.1.0 and 5.1.1, viewpagerdotsindicator/build.gradle.kts changed jvmToolchain(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):

version major version Java
5.1.0 61 17
5.1.1 65 21

Fix

  • Restore jvmToolchain(17) for the library module (the sample app is untouched — it is not published).
  • Add a CI step after assembleRelease that 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

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
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