Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ an AGP version created before 9.0.0 to an AGP version 9.0.0+.
You should also use the minimum compatible dependency versions
listed in the [Android Gradle Plugin docs][AGP block].

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

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?


To verify whether your app applies KGP,
find the `kotlin-android` plugin
(or the `org.jetbrains.kotlin.android` plugin).
It is likely located in the
`<app-src>/android/app/build.gradle` or
`<app-src>/android/app/build.gradle.kts` file.
To view the KGP application code,
see [Update the Gradle file](#update-the-gradle-file).

If your app doesn't currently apply KGP,
don't migrate to built-in Kotlin.
:::
Comment thread
jesswrd marked this conversation as resolved.

:::note
To update Flutter plugins to use built-in Kotlin,
follow the [migration guide for plugin authors][].
Expand Down Expand Up @@ -299,6 +316,8 @@ kotlin {
Before enabling built-in Kotlin,
confirm that you have migrated your application
and any Flutter plugins it uses.
Also, confirm that you updated your app
to AGP 9+, because built-in Kotlin requires AGP 9+.

To enable built-in Kotlin,
set the `android.builtInKotlin` property to `true`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ description: >-

This guide outlines the migration steps specifically for plugin authors.

:::warning
This guide only applies to plugins that already use the
Kotlin Gradle Plugin (KGP).

To verify whether your plugin applies KGP,
find the `kotlin-android` plugin
(or the `org.jetbrains.kotlin.android` plugin).
It is likely located in the
`<plugin-project>/android/build.gradle` or
`<plugin-project>/android/build.gradle.kts` file.
To view the KGP application code,
see [Update the Gradle file](#update-the-gradle-file).

If your plugin project doesn't currently apply KGP,
don't migrate to built-in Kotlin.
:::
Comment thread
jesswrd marked this conversation as resolved.

:::note
To update Flutter apps to use built-in Kotlin,
follow the [migration guide for app developers][].
Expand All @@ -24,9 +41,9 @@ follow the instructions to
First, find the `kotlin-android` plugin
(or the `org.jetbrains.kotlin.android` plugin).
It is likely located in the `plugins` block of the
`<plugin-project>/build.gradle` or the `<plugin-project>/build.gradle.kts` file.
`<plugin-project>/android/build.gradle` or the `<plugin-project>/android/build.gradle.kts` file.
If you use the legacy `apply` syntax,
it will be located in the Groovy-based `<plugin-project>/build.gradle` file,
it will be located in the Groovy-based `<plugin-project>/android/build.gradle` file,
as this syntax isn't supported in Kotlin DSL.

The following examples demonstrate how to migrate a Flutter plugin:
Expand Down Expand Up @@ -422,6 +439,8 @@ the newly released plugin version:
Before enabling built-in Kotlin,
confirm that you have migrated your plugin example app
and any Flutter plugins it uses.
Also, confirm that you updated your plugin example app
to AGP 9+, because built-in Kotlin requires AGP 9+.

To enable built-in Kotlin,
set the `android.builtInKotlin` property to `true`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ description: >-

{% render "docs/breaking-changes.md" %}

:::warning
This guide only applies to apps and plugins that already use the
Kotlin Gradle Plugin (KGP).
If your project doesn't currently apply KGP,
don't migrate to built-in Kotlin.
:::
Comment thread
jesswrd marked this conversation as resolved.

## Summary

To build a Flutter app for Android,
Expand Down
Loading