Skip to content

fix(desktop_drop): stop Flutter's false KGP warning with built-in Kotlin - #547

Merged
boyan01 merged 1 commit into
MixinNetwork:mainfrom
xsahil03x:desktop-drop-kgp-warning
Oct 20, 2026
Merged

boyan01 merged 1 commit into
MixinNetwork:mainfrom
xsahil03x:desktop-drop-kgp-warning

Conversation

@xsahil03x

Copy link
Copy Markdown
Contributor

Fixes #546.

desktop_drop applies the Kotlin Gradle Plugin only when built-in Kotlin is off. Flutter, though, detects KGP use by searching each plugin's build script for an apply plugin: 'kotlin-android' line. So every Android build listed desktop_drop under "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 change photo_manager made in fluttercandies/flutter_photo_manager#1451.

Verification

Built the example with flutter build apk --debug on Flutter 3.47.7. Each build succeeds and DesktopDropPlugin is in the APK:

Setup Before After
AGP 9.1.0, android.builtInKotlin=true (the example's own setup) warning lists desktop_drop no warning
AGP 9.1.0, android.builtInKotlin=false — no warning
AGP 8.12.2 — no warning

🤖 Generated with Claude Code

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>
@xsahil03x

Copy link
Copy Markdown
Contributor Author

@boyan01 could you take a look when you have a moment? It's a one-line follow-up to #500: same condition, but it stops Flutter listing desktop_drop in its plugins that apply KGP warning on every Android build. Thanks!

@boyan01
boyan01 merged commit b13faba into MixinNetwork:main Oct 20, 2026
4 checks passed
@boyan01

boyan01 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Thanks @xsahil03x! Verified locally on Flutter 3.47.7: the warning is gone with android.builtInKotlin=true, and the example still builds with android.builtInKotlin=false. I'll include this in the next desktop_drop release.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[desktop_drop] Flutter warns that desktop_drop applies the Kotlin Gradle Plugin when built-in Kotlin is enabled

2 participants