Skip to content

Fix build.gradle file paths in Kotlin migration guide#13342

Open
lsaudon wants to merge 1 commit intoflutter:mainfrom
lsaudon:patch-1
Open

Fix build.gradle file paths in Kotlin migration guide#13342
lsaudon wants to merge 1 commit intoflutter:mainfrom
lsaudon:patch-1

Conversation

@lsaudon
Copy link
Copy Markdown
Contributor

@lsaudon lsaudon commented Apr 30, 2026

Description of what this PR is changing or adding, and why:

Fixes incorrect file paths in the Kotlin migration guide.
The build.gradle / build.gradle.kts references pointed to <app-src>/android/build.gradle instead of the correct <app-src>/android/app/build.gradle.
The kotlin-android plugin and kotlinOptions block live in the app-level Gradle file, not the project-level one.

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.

@lsaudon lsaudon requested review from a team and sfshaza2 as code owners April 30, 2026 19:47
Copy link
Copy Markdown
Contributor

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

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 Kotlin migration guide for app developers by correcting the file paths for Android build configuration files to include the app directory. The review feedback suggests extending these updates to the plugin authors' guide for consistency and refining the path placeholders for add-to-app host projects to more accurately reflect native Android project structures.

It is likely located in the `plugins` block of the
`<app-src>/android/build.gradle` or the
`<app-src>/android/build.gradle.kts` file.
`<app-src>/android/app/build.gradle` or the
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 PR title indicates a fix for the 'Kotlin migration guide', but it currently only updates for-app-developers.md. The for-plugin-authors.md file in the same directory also contains incorrect paths (e.g., using <app-src> instead of <plugin-project> and missing the correct directory structure) and should be updated to ensure the entire guide is accurate.

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.

Irrelevant. Path is good for plugin.

**Before**:

```kotlin title="<app-src>/android/build.gradle(.kts)"
```kotlin title="<app-src>/android/app/build.gradle(.kts)"
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

For add-to-app host apps, the project structure is typically that of a native Android project where the app module is located directly in the app/ directory of the project root. Therefore, the path should be <host-app-project>/app/build.gradle(.kts) instead of <app-src>/android/app/build.gradle(.kts). This also maintains consistency with the placeholder used on line 37.

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.

Not related to my edit.

Next, remove the `kotlin-android` plugin and the `kotlinOptions` block:

```kotlin diff title="<app-src>/android/build.gradle.kts"
```kotlin diff title="<app-src>/android/app/build.gradle.kts"
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

As noted in the previous comment, for add-to-app host apps, the path should be <host-app-project>/app/build.gradle.kts to reflect the standard native Android project structure and maintain consistency with the <host-app-project> placeholder.

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.

Not related to my edit.

Add the `kotlin.compilerOptions{}` DSL block with the following:

```kotlin diff title="<app-src>/android/build.gradle.kts"
```kotlin diff title="<app-src>/android/app/build.gradle.kts"
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

As noted in the previous comments, for add-to-app host apps, the path should be <host-app-project>/app/build.gradle.kts to reflect the standard native Android project structure and maintain consistency with the <host-app-project> placeholder.

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.

Not related to my edit.

**After**:

```kotlin title="<app-src>/android/build.gradle(.kts)"
```kotlin title="<app-src>/android/app/build.gradle(.kts)"
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

As noted in the previous comments, for add-to-app host apps, the path should be <host-app-project>/app/build.gradle(.kts) to reflect the standard native Android project structure and maintain consistency with the <host-app-project> placeholder.

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.

Not related to my edit.

@sfshaza2
Copy link
Copy Markdown
Contributor

sfshaza2 commented May 1, 2026

/gcbrun

@lsaudon, can you address the bot's comments?

@flutter-website-bot
Copy link
Copy Markdown
Collaborator

Visit the preview URL for this PR (updated for commit 5d40448):

https://flutter-docs-prod--pr13342-patch-1-qog8bmb9.web.app

@sfshaza2 sfshaza2 added the act.wait-for-customer Needs response from customer label May 4, 2026
@lsaudon
Copy link
Copy Markdown
Contributor Author

lsaudon commented May 5, 2026

Hi @sfshaza2,

The comments are either wrong or not directly related to my edit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act.wait-for-customer Needs response from customer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants