Skip to content

[AGP 9] Migrate Remaining Plugin Example Apps to Built-in Kotlin#11806

Open
jesswrd wants to merge 2 commits into
flutter:mainfrom
jesswrd:migrate-remaining-example-apps-bk
Open

[AGP 9] Migrate Remaining Plugin Example Apps to Built-in Kotlin#11806
jesswrd wants to merge 2 commits into
flutter:mainfrom
jesswrd:migrate-remaining-example-apps-bk

Conversation

@jesswrd
Copy link
Copy Markdown
Contributor

@jesswrd jesswrd commented May 30, 2026

Migrate remaining example apps to built-in kotlin.

Fixes flutter/flutter#187325

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@jesswrd jesswrd marked this pull request as ready for review June 1, 2026 14:03
Copy link
Copy Markdown

@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 migrates multiple Android example apps to use Flutter's built-in Kotlin support, upgrading Gradle to version 9.1.0, updating Android and Kotlin plugin versions, and replacing deprecated kotlinOptions with the new kotlin compiler options block. Review feedback indicates that the android.builtInKotlin and android.newDsl flags in gradle.properties must be set to true instead of false to ensure Kotlin compilation is correctly applied and prevent build failures.

Comment thread packages/animations/example/android/gradle.properties
Comment thread packages/camera/camera/example/android/gradle.properties
Comment thread packages/espresso/example/android/gradle.properties
@jesswrd jesswrd requested a review from stuartmorgan-g June 1, 2026 19:53
@jesswrd jesswrd marked this pull request as draft June 1, 2026 22:32
@jesswrd jesswrd removed the request for review from stuartmorgan-g June 1, 2026 22:32
@jesswrd jesswrd changed the title [AGP 9] Migrate Remaining Plugin Example Apps to Built-in Kotlin [WIP] [AGP 9] Migrate Remaining Plugin Example Apps to Built-in Kotlin Jun 1, 2026
@jesswrd jesswrd changed the title [WIP] [AGP 9] Migrate Remaining Plugin Example Apps to Built-in Kotlin [AGP 9] Migrate Remaining Plugin Example Apps to Built-in Kotlin Jun 2, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 2, 2026
@jesswrd jesswrd changed the title [AGP 9] Migrate Remaining Plugin Example Apps to Built-in Kotlin [WIP] [AGP 9] Migrate Remaining Plugin Example Apps to Built-in Kotlin Jun 2, 2026
@jesswrd jesswrd added the CICD Run CI/CD label Jun 2, 2026
@jesswrd jesswrd changed the title [WIP] [AGP 9] Migrate Remaining Plugin Example Apps to Built-in Kotlin [AGP 9] Migrate Remaining Plugin Example Apps to Built-in Kotlin Jun 2, 2026
@jesswrd jesswrd marked this pull request as ready for review June 2, 2026 17:07
@jesswrd jesswrd requested a review from stuartmorgan-g June 2, 2026 17:07
Copy link
Copy Markdown

@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 multiple example Android applications and validation tests to upgrade Gradle to 9.1.0, the Android Gradle Plugin to 9.0.1, and Kotlin to 2.3.20. It removes the kotlin-android plugin and migrates kotlinOptions to the new kotlin compiler options block targeting JVM 17. Feedback across several files indicates that setting android.builtInKotlin and android.newDsl to false in gradle.properties will cause build failures since the kotlin-android plugin was removed. These flags should be updated to true to enable built-in Kotlin support.

Comment on lines +4 to +7
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Since the goal of this pull request is to migrate the example apps to built-in Kotlin and the new DSL, these flags should be set to true. Setting them to false disables the built-in Kotlin support.

Furthermore, because kotlin-android was removed from build.gradle.kts, having android.builtInKotlin=false will cause Gradle to fail with an error like Extension with name 'kotlin' does not exist because the Kotlin plugin is never applied.

Please update this flag to true across all gradle.properties files in this PR.

# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=true
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=true

Comment on lines +4 to +7
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Since the goal of this pull request is to migrate the example apps to built-in Kotlin and the new DSL, these flags should be set to true. Setting them to false disables the built-in Kotlin support.

Furthermore, because kotlin-android was removed from build.gradle.kts, having android.builtInKotlin=false will cause Gradle to fail with an error like Extension with name 'kotlin' does not exist because the Kotlin plugin is never applied.

Please update this flag to true across all gradle.properties files in this PR.

# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=true
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=true

Comment on lines +4 to +7
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Since the goal of this pull request is to migrate the example apps to built-in Kotlin and the new DSL, these flags should be set to true. Setting them to false disables the built-in Kotlin support.

Furthermore, because kotlin-android was removed from build.gradle.kts, having android.builtInKotlin=false will cause Gradle to fail with an error like Extension with name 'kotlin' does not exist because the Kotlin plugin is never applied.

Please update this flag to true across all gradle.properties files in this PR.

# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=true
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=true

Comment on lines +4 to +7
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Since the goal of this pull request is to migrate the example apps to built-in Kotlin and the new DSL, these flags should be set to true. Setting them to false disables the built-in Kotlin support.

Furthermore, because kotlin-android was removed from build.gradle.kts, having android.builtInKotlin=false will cause Gradle to fail with an error like Extension with name 'kotlin' does not exist because the Kotlin plugin is never applied.

Please update this flag to true across all gradle.properties files in this PR.

# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=true
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=true

Comment on lines +4 to +7
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Since the goal of this pull request is to migrate the example apps to built-in Kotlin and the new DSL, these flags should be set to true. Setting them to false disables the built-in Kotlin support.

Furthermore, because kotlin-android was removed from build.gradle.kts, having android.builtInKotlin=false will cause Gradle to fail with an error like Extension with name 'kotlin' does not exist because the Kotlin plugin is never applied.

Please update this flag to true across all gradle.properties files in this PR.

# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=true
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=true

Comment on lines +4 to +7
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Since the goal of this pull request is to migrate the example apps to built-in Kotlin and the new DSL, these flags should be set to true. Setting them to false disables the built-in Kotlin support.

Furthermore, because kotlin-android was removed from build.gradle.kts, having android.builtInKotlin=false will cause Gradle to fail with an error like Extension with name 'kotlin' does not exist because the Kotlin plugin is never applied.

Please update this flag to true across all gradle.properties files in this PR.

# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=true
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=true

Comment on lines +4 to +7
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Since the goal of this pull request is to migrate the example apps to built-in Kotlin and the new DSL, these flags should be set to true. Setting them to false disables the built-in Kotlin support.

Furthermore, because kotlin-android was removed from build.gradle.kts, having android.builtInKotlin=false will cause Gradle to fail with an error like Extension with name 'kotlin' does not exist because the Kotlin plugin is never applied.

Please update this flag to true across all gradle.properties files in this PR.

# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=true
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=true

@jesswrd
Copy link
Copy Markdown
Contributor Author

jesswrd commented Jun 2, 2026

@stuartmorgan-g I noticed there aren't really any existing validators for configurations like kotlinOptions{} in example plugin apps. Do you happen to know why? If there isn't an explicit reason for excluding those tests, I'm going to add them.

@stuartmorgan-g
Copy link
Copy Markdown
Collaborator

@stuartmorgan-g I noticed there aren't really any existing validators for configurations like kotlinOptions{} in example plugin apps. Do you happen to know why?

I'm pretty sure I just missed adding some validation when I was doing the Kotlin gradle migrations. As I'm sure you're well aware by now, keeping track of which things are in which variants and which ones have been validated is... nontrivial :)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AGP 9] Migrate All Plugin Example Apps to Built-in Kotlin

2 participants