Repository navigation
fix(desktop_drop): stop Flutter's false KGP warning with built-in Kotlin - #547
Merged
Merged
Conversation
Apply the Kotlin Gradle Plugin through the plugin manager instead of `apply plugin:`. The condition is unchanged, but Flutter detects KGP use by searching build scripts for that line, so it listed desktop_drop as applying KGP even when built-in Kotlin was on. Fixes MixinNetwork#546 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
Contributor
|
Thanks @xsahil03x! Verified locally on Flutter 3.47.7: the warning is gone with |
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.
Fixes #546.
desktop_dropapplies the Kotlin Gradle Plugin only when built-in Kotlin is off. Flutter, though, detects KGP use by searching each plugin's build script for anapply plugin: 'kotlin-android'line. So every Android build listeddesktop_dropunder "plugins that apply Kotlin Gradle Plugin", even when built-in Kotlin was on and the line never ran.This applies the plugin through
project.pluginManager.apply('kotlin-android'), under the same condition. Behaviour is unchanged; only the false warning goes away. It's the same changephoto_managermade in fluttercandies/flutter_photo_manager#1451.Verification
Built the example with
flutter build apk --debugon Flutter 3.47.7. Each build succeeds andDesktopDropPluginis in the APK:android.builtInKotlin=true(the example's own setup)desktop_dropandroid.builtInKotlin=false🤖 Generated with Claude Code