Skip to content

[WIP] Added warning against migration to built-in kotlin - #13634

Draft
jesswrd wants to merge 7 commits into
flutter:mainfrom
jesswrd:migration-warning
Draft

[WIP] Added warning against migration to built-in kotlin#13634
jesswrd wants to merge 7 commits into
flutter:mainfrom
jesswrd:migration-warning

Conversation

@jesswrd

@jesswrd jesswrd commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

DO NOT MERGE

Added warning against migrating to built-in kotlin if project does not currently use KGP. Also added apps should be on AGP 9+ when validating migration.

Presubmit checklist

  • If you are unwilling, or unable, to sign the CLA, even for a tiny, one-word PR, please file an issue instead of a PR.
  • If this PR is not meant to land until a future stable release, mark it as draft with an explanation.
  • This PR follows the Google Developer Documentation Style Guidelines—for example, it doesn't use i.e. or e.g., and it avoids I and we (first-person pronouns).
  • This PR uses semantic line breaks
    of 80 characters or fewer.

@jesswrd
jesswrd requested review from a team and sfshaza2 as code owners July 28, 2026 00:50

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds warning callouts to the Kotlin migration documentation to clarify that the migration is only relevant for projects already using the Kotlin Gradle Plugin (KGP). The reviewer suggested rephrasing these warnings across all three files to specify that the migration itself is what only applies to KGP-using projects, rather than the entire guide, which resolves contradictions and ensures accuracy.

@flutter-website-bot

flutter-website-bot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Staged preview of the updated docs.flutter.dev site (updated for commit b3605d7):

https://flutter-docs-prod--docs-pr13634-migration-warning-1du7aw2r.web.app

@flutter-website-bot

flutter-website-bot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Staged preview of the updated flutter.dev site (updated for commit b3605d7):

https://flutter-dev-230821--www-pr13634-migration-warning-ug8ucv7l.web.app

@liamappelbe

Copy link
Copy Markdown

Can the warning also mention what it means to "apply KGP"? Something like "If your project doesn't currently apply KGP (ie your gradle file doesn't have a line like apply plugin: 'kotlin-android'), ...".

:::warning
This guide only applies to apps that already use the
Kotlin Gradle Plugin (KGP).
If your project doesn't currently apply KGP,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will they know if their project applies KGP?

@jesswrd jesswrd Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devs can check if their project applies KGP by looking at their build.gradle(.kts) file. Instructions on how to identify and locate KGP already exist in the doc for app devs and plugin authors. I can just add something like that in the warning at the top of the doc for app devs and plugin authors.

@jesswrd
jesswrd requested a review from jmagman July 30, 2026 16:47

@parlough parlough left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jesswrd! Generally looks good to me, but one potential issue and a question:

Comment on lines +15 to +16
This guide only applies to apps that already use the
Kotlin Gradle Plugin (KGP).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the requirement to add android.newDsl=false mentioned in the next section? Do apps that don't use KGP or add-to-app apps need to add that either way?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

android.newDsl=false is completely separate from KGP/migrating to built-in kotlin. Whether or not an app is applying KGP, android.newDsl=false must be set to succesfully build an app using AGP 9. So there are technically two parts to successfully building on AGP 9:

  1. migrate to built-in kotlin (if applicable)
  2. android.newDsl is false (this only has to be manually set for add-to-app scenarios)

This guide is specifically for those migrating to built-in kotlin. I do think the above^ is important to communicate. Any guidance for how to communicate it? (as a part of this guide? another doc?).

…lt-in-kotlin/for-plugin-authors.md

Co-authored-by: Parker Lougheed <parlough@gmail.com>
@jesswrd jesswrd changed the title Added warning against migration to built-in kotlin [WIP] Added warning against migration to built-in kotlin Aug 3, 2026
@jesswrd
jesswrd marked this pull request as draft August 3, 2026 04:07
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.

5 participants