Repository navigation
fix(android): support AGP 9's built-in Kotlin - #6
Closed
TheoGermain wants to merge 3 commits into
Closed
TheoGermain wants to merge 3 commits into
TheoGermain wants to merge 3 commits into
Conversation
AGP 9 makes the org.jetbrains.kotlin.android plugin's Kotlin support redundant and rejects it outright: The 'org.jetbrains.kotlin.android' plugin is no longer required for Kotlin support since AGP 9.0. Guard the plugin application behind an AGP-major-version check, same pattern already shipped by device_info_plus, package_info_plus and share_plus for this exact migration.
compileSdkVersion 30 is too old for several transitive androidx dependencies (activity, arch-core, window.extensions.core), which now require compiling against API 33/34+. AGP 9 turns this AAR metadata mismatch into a hard build failure instead of a warning.
…piling Same issue as reviewed on the sentry-dart / mixpanel-flutter equivalents: - honor the android.builtInKotlin=false escape hatch, not just AGP major version. - JvmTarget.JVM_1_8 requires KGP 1.9.0+, incompatible with this module's own pinned kotlin_version 1.5.20 on the AGP<9 path. Keep the original string-based kotlinOptions there.
TheoGermain
added a commit
to TheoGermain/mixpanel-flutter
that referenced
this pull request
Aug 14, 2026
Same review feedback landed on HelloPrimary/firebase_app_distribution#6 and getsentry/sentry-dart#3970: android.builtInKotlin=false is the documented way to opt back out of AGP 9's built-in Kotlin, so the guard must check it, not just the AGP major version. Restores the original kotlinOptions block (unaffected by JvmTarget enum version quirks) for that path.
Collaborator
|
Merged into main via rebase (82b3f28) — verified on Flutter 3.47.5 / AGP 9.1 with built-in Kotlin enabled and with |
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.
AGP 9 makes the
org.jetbrains.kotlin.androidplugin redundant and rejects it outright at build time:This guards the plugin application behind an AGP-major-version check, the same pattern already shipped by
device_info_plus,package_info_plusandshare_plusfor this exact migration (reference).Tested against a Flutter 3.47 / AGP 9.3.0 app — builds cleanly with this change, fails without it.