Skip to content

fix(android): conditionally apply kotlin-android for AGP 9 built-in Kotlin support#142

Merged
onevcat merged 1 commit into
line:masterfrom
yuki-sakakibara:fix/agp9-builtin-kotlin-support
Apr 3, 2026
Merged

fix(android): conditionally apply kotlin-android for AGP 9 built-in Kotlin support#142
onevcat merged 1 commit into
line:masterfrom
yuki-sakakibara:fix/agp9-builtin-kotlin-support

Conversation

@yuki-sakakibara

Copy link
Copy Markdown

AGP 9+ has built-in Kotlin support, and explicitly applying kotlin-android conflicts with it.

This change conditionally applies kotlin-android and kotlinOptions only when AGP < 9.

References

@onevcat onevcat requested a review from YkSix April 3, 2026 01:44
@onevcat

onevcat commented Apr 3, 2026

Copy link
Copy Markdown
Member

Thanks for the PR! The approach looks correct to me — conditionally applying kotlin-android based on the AGP version makes sense.

I'm not super confident with the Android build system though, so @YkSix could you take a look? It would be great if you could also verify this with an AGP 9 environment to make sure everything builds cleanly.

@onevcat onevcat merged commit 74368db into line:master Apr 3, 2026
1 check passed
@onevcat

onevcat commented Apr 3, 2026

Copy link
Copy Markdown
Member

Since our Android expert is currently on vacation, I verified locally that this change doesn't break existing builds on AGP < 9. Flutter itself doesn't support AGP 9 for plugins yet (see flutter/flutter#181383), so we can't fully verify the AGP 9 path at this time. Merging for now — we'll revisit and do a full verification once Flutter officially supports AGP 9.

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