Repository navigation
[flutter_tools] Say whether the app or a plugin applies kotlin-android under built-in Kotlin - #195081
Draft
reidbaker-agent wants to merge 2 commits into
Draft
reidbaker-agent wants to merge 2 commits into
reidbaker-agent wants to merge 2 commits into
Conversation
…d under built-in Kotlin applyingKotlinAndroidPluginErrorHandler now matches the Kotlin Gradle Plugin line that names the offending build file. For the app module it lists the migration steps. For a plugin it says to upgrade or report the plugin and how to build until then.
This was referenced Oct 22, 2026
Member
|
@jesswrd I have not reviewed this yet but wanted you to know it existed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
android.builtInKotlin=trueand a build file still applieskotlin-android, Flutter's message said "Starting AGP 9+, the default has become built-in Kotlin". It did not say whether the app or a plugin had to change.The message now names the build file. For the app, it lists the migration steps. For a plugin, it says to upgrade or report the plugin, and how to build until then.
Related to #189235 and #181557.
Agent authored details
applyingKotlinAndroidPluginErrorHandlernow matches the Kotlin Gradle Plugin lineSolution: Remove the 'org.jetbrains.kotlin.android' plugin from this project's build file: <path>.and reads the path. Before, it matched the line above it. The path is relative to the Android root project, with the platform separator, so Windows separators are normalized.app/build.gradle(.kts)gets the app message; any other path gets the plugin message.The escape hatch in the plugin message needs both properties: with
builtInKotlin=falseandnewDsl=true, the Kotlin Gradle Plugin still refuses to apply.Real output, AGP 9.3.1 and KGP 2.4.20, app applying kotlin-android:
A plugin applying kotlin-android:
Removed test:
Failure to apply kotlin-android plugin. It asserted the old message text. It is replaced by thekotlin-android plugin with built-in Kotlingroup, which covers the matcher, the app message, a Windows path and the plugin message.Added constant
kMigrateAppToBuiltInKotlinDocsUrl. The page exists, coverskotlinOptions→compilerOptions, and has the section on reporting plugins.A cherry-pick to
flutter-3.50-candidate.0needs a small backport:gradle_errors.dartwas refactored on master after the branch point (#193649).Verification:
flutter test test/general.shard/android/gradle_errors_test.dartpassed (61 tests).dart analyze --fatal-infosanddart formatpassed on the changed files. Manual builds were run for both cases.Known limits: in add-to-app hosts, or for an app module not named
app, the wording is less precise (plugin branch, or anandroid/prefix). The exit status is unchanged.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot 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.