Skip to content

fix(android): bump JVM target from 11 to 17#68

Draft
airowe wants to merge 1 commit into
frontegg:masterfrom
healthie:fix/android-jvm-target-17
Draft

fix(android): bump JVM target from 11 to 17#68
airowe wants to merge 1 commit into
frontegg:masterfrom
healthie:fix/android-jvm-target-17

Conversation

@airowe
Copy link
Copy Markdown

@airowe airowe commented May 28, 2026

Summary

Bumps sourceCompatibility / targetCompatibility / kotlinOptions.jvmTarget in android/build.gradle from 11 to 17 so the library compiles against host apps using the modern React Native / AGP defaults.

Problem

React Native 0.80+ projects compile host-app Java with JVM 17. AGP enforces JVM-target consistency between compileDebugJavaWithJavac and compileDebugKotlin, so any consumer on JVM 17 hits:

> Inconsistent JVM-target compatibility detected for tasks
> 'compileDebugJavaWithJavac' (17) and 'compileDebugKotlin' (11).

…on :react-native_frontegg:compileDebugKotlin. We've been carrying this as a patch-package patch on @frontegg/react-native@1.2.16 to get the library to build at all.

Compatibility note

JDK 17 has been the recommended Android Studio toolchain since Flamingo (April 2023) and is required by AGP 8.x. Host apps still on JDK 11 will need their AGP version to support sourceCompatibility 17 (AGP 7.4+).

Manual test plan

Reviewer / maintainer:

  • On JDK 17 + AGP 8.x: cd example/android && ./gradlew :react-native_frontegg:assembleDebug succeeds. (Before this PR: fails with the JVM-target inconsistency error above.)
  • On JDK 17 + AGP 8.x: cd example/android && ./gradlew :app:assembleDebug succeeds and the example app installs and launches.
  • Existing E2E suite (react-native-sdk-e2e.yml) is green on this branch.

The fix is a 6-character config change with no runtime behavior, so unit-test coverage is not added; the gradle build is itself the test.

Tested against (host side)

  • React Native 0.80, AGP 8.x, JDK 17 — Healthie's app, multiple white-label flavors.

Related

Part of a small batch of patches we discovered while integrating the SDK; the others are separate PRs (currentActivity deprecation, BuildConfig lookup).

React Native 0.80+ ships with Gradle/AGP defaults that compile host
app Java with JVM 17. AGP's `JavaCompile` / `KotlinCompile` consistency
check fails the Kotlin compile task when this library's `jvmTarget`
("11") disagrees with the consumer's compileJavaWithJavac target ("17").

Bumping both `sourceCompatibility`/`targetCompatibility` and
`kotlinOptions.jvmTarget` to 17 aligns the library with the modern RN
toolchain. Apps still on JVM 11 are unaffected as long as their AGP
version supports JDK 17 source level (AGP 7.4+).

Repro: any RN 0.80+ host project pulling `@frontegg/react-native`
fails `:react-native_frontegg:compileDebugKotlin` with:

  > Inconsistent JVM-target compatibility detected for tasks
  > 'compileDebugJavaWithJavac' (17) and 'compileDebugKotlin' (11).
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