Repository navigation
fix(android): support AGP 9 built-in Kotlin - #477
Open
453zhangqiang-star wants to merge 1 commit into
Open
453zhangqiang-star wants to merge 1 commit into
453zhangqiang-star wants to merge 1 commit into
Conversation
23 tasks
RahulBhanushali0
approved these changes
Oct 14, 2026
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.
What
Migrate the Android build so it supports AGP 9 built-in Kotlin, while keeping the legacy
Kotlin Gradle Plugin (KGP) path working for older AGP versions.
Why
AGP 9 enables built-in Kotlin and no longer allows library subprojects to apply the
Kotlin Gradle Plugin. Flutter documents this migration and warns about plugins that
still apply KGP; future Flutter versions will fail to build them:
The same pattern has already been merged upstream in
flutter_timezone5.1.1,wakelock_plus1.7.0+, andsign_in_with_apple8.2.0.How
agpMajor < 9 || android.builtInKotlin != true).pluginManager.apply(...)instead ofapply plugin:, so Flutter's static KGPdetection (which pattern-matches build file text) does not flag the plugin.
kotlinOptionson the legacy path; usekotlin.compilerOptionswhen built-inKotlin is active.
No Dart or native API changes.
Testing
Build-configuration only; no behavior change on the legacy path.
I have not run this repo's example app build yet — happy to run it on request, or you can
trigger CI. Please tell me if you prefer a different structure and I will adjust.