Skip to content

feat(android): Migrate Plugin to Built-in Kotlin - #721

Merged
ened merged 2 commits into
fluttercommunity:mainfrom
EdwynZN:fix/agp9-migration
Aug 4, 2026
Merged

feat(android): Migrate Plugin to Built-in Kotlin#721
ened merged 2 commits into
fluttercommunity:mainfrom
EdwynZN:fix/agp9-migration

Conversation

@EdwynZN

@EdwynZN EdwynZN commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Following #710 this fixes the use of AGP+9 and also when using android.builtInKotlin=false in gradle.properties (while android.builtInKotlin=false is discouraged to use in AGP9 it can still be false in this version until the migration is complete)

  • Apply kotlin-android whenever built-in Kotlin is not active

@EdwynZN EdwynZN changed the title Migrate Plugin to Built-in Kotlin feat(android): Migrate Plugin to Built-in Kotlin Aug 3, 2026
@ened

ened commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Thanks @EdwynZN — great catch, and your guard logic is the right one: AGP 9.0 enables built-in Kotlin by default, so treating the property as active unless explicitly false matches AGP's real semantics (a == 'true' check would wrongly apply KGP when the property is absent).

I pushed a small follow-up to your branch (comment only — it still said builtInKotlin=false means "no Kotlin plugin compiles at all", which this fix changes): 635ea4a.

Verified locally against the exact environment from #722 (AGP 9.0.1, KGP 2.3.20, android.newDsl=false, android.builtInKotlin=false): pre-fix evaluation fails with Could not find method kotlin() at line 60, post-fix BUILD SUCCESSFUL with the full plugin compiled into the AAR (74 classes incl. WorkmanagerPlugin/BackgroundWorker). builtInKotlin=true mode and the AGP 8.11 path (50 unit tests) also green.

Can you confirm this fixes the build for you? Also approved the CI runs for this PR.

@ened
ened merged commit 1e8ff5d into fluttercommunity:main Aug 4, 2026
19 checks passed
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.

2 participants