Skip to content

Added warning against migration to built-in kotlin - #13634

Merged
jesswrd merged 7 commits into
flutter:mainfrom
jesswrd:migration-warning
Aug 5, 2026
Merged

Added warning against migration to built-in kotlin#13634
jesswrd merged 7 commits into
flutter:mainfrom
jesswrd:migration-warning

Conversation

@jesswrd

@jesswrd jesswrd commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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?).

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 for the clarification. I would consider creating an additional short and focused migration doc, potentially limited to the add-to-app scenario?

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.

Sounds good. I'll do that in a different change.

…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
@jesswrd jesswrd changed the title [WIP] Added warning against migration to built-in kotlin Added warning against migration to built-in kotlin Aug 5, 2026
@jesswrd
jesswrd marked this pull request as ready for review August 5, 2026 15:04
@jesswrd
jesswrd merged commit 6fc5d49 into flutter:main Aug 5, 2026
14 checks passed

@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 updates the documentation for migrating to built-in Kotlin for Flutter apps and plugins. It adds warnings that the migration only applies to projects already using the Kotlin Gradle Plugin (KGP), clarifies that AGP 9+ is required, and corrects some Gradle file paths for plugin projects. The review feedback suggests improving clarity by rephrasing 'KGP application code' to 'how KGP is applied' in both the app developer and plugin author guides to avoid confusion with Android applications.

Comment on lines +24 to +25
To view the KGP application code,
see [Update the Gradle file](#update-the-gradle-file).

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.

medium

The phrase 'KGP application code' can be confusing because 'application' is often interpreted as an Android application (app) rather than the act of applying a plugin. Consider rephrasing this to 'how KGP is applied' or 'examples of how KGP is applied' to improve clarity.

Suggested change
To view the KGP application code,
see [Update the Gradle file](#update-the-gradle-file).
To see how KGP is applied,
see [Update the Gradle file](#update-the-gradle-file).

Comment on lines +19 to +20
To view the KGP application code,
see [Update the Gradle file](#update-the-gradle-file).

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.

medium

The phrase 'KGP application code' is confusing here, especially for plugin authors, as 'application' typically refers to an Android application rather than the act of applying a plugin. Rephrasing this to 'how KGP is applied' or 'examples of how KGP is applied' would be much clearer.

Suggested change
To view the KGP application code,
see [Update the Gradle file](#update-the-gradle-file).
To see how KGP is applied,
see [Update the Gradle file](#update-the-gradle-file).

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