fix: apply Kotlin Gradle Plugin only when AGP has no built-in Kotlin - #946
Closed
utkrishtsahu wants to merge 1 commit into
Closed
fix: apply Kotlin Gradle Plugin only when AGP has no built-in Kotlin#946utkrishtsahu wants to merge 1 commit into
utkrishtsahu wants to merge 1 commit into
Conversation
utkrishtsahu
temporarily deployed
to
internal
September 9, 2026 10:42 — with
GitHub Actions
Inactive
utkrishtsahu
temporarily deployed
to
internal
September 9, 2026 10:42 — with
GitHub Actions
Inactive
utkrishtsahu
temporarily deployed
to
internal
September 9, 2026 10:42 — with
GitHub Actions
Inactive
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (3)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
📋 Changes
Android Gradle Plugin 9 compiles Kotlin itself ("built-in Kotlin") and fails the build when a module also applies the Kotlin Gradle Plugin (KGP):
Flutter 3.47 scaffolds apps on AGP 9.1.0, so any app depending on
auth0_fluttercurrently has to opt out withandroid.builtInKotlin=false— which in turn forces every other plugin in the app back onto KGP.This changes
auth0_flutter/android/build.gradleto apply KGP only where AGP will not compile Kotlin itself:android.builtInKotlin=false: KGP is applied, as before.The
kotlinOptions { jvmTarget = '17' }block is KGP-only DSL and does not exist under built-in Kotlin, so it moves behindplugins.withId("org.jetbrains.kotlin.android")usingJvmTarget.JVM_17; with built-in Kotlin, AGP derives the JVM target fromcompileOptions.targetCompatibility(alreadyVERSION_17).pluginManager.apply('kotlin-android')is used instead ofapply plugin:on purpose: the Flutter tool detects KGP usage by regex-scanning plugin build scripts and would otherwise keep listingauth0_flutterin its KGP notice even on AGP 9, where this branch never runs. This mirrors the conditional apply shipped byfirebase_core,stripe_android, andmobile_scanner.No public API change.
Fixes #923.
🎯 Testing
Build-script only; no runtime code changes.
auth0_flutter/exampleapp to a debug APK on AGP 8.10.1:✓ Built build/app/outputs/flutter-apk/app-debug.apk. On AGP ≤ 8 the script takes the originalagpMajor < 9branch and applies KGP identically to before, so existing consumers are unaffected.