chore: stop applying KGP (Kotlin Gradle Plugin) in the app, upgrade wakelock_plus to 1.7.0 - #1170
Open
anhappdev wants to merge 1 commit into
Open
chore: stop applying KGP (Kotlin Gradle Plugin) in the app, upgrade wakelock_plus to 1.7.0#1170anhappdev wants to merge 1 commit into
anhappdev wants to merge 1 commit into
Conversation
Flutter 3.44 warns that applying the Kotlin Gradle Plugin in the app project will break future builds, and asks apps to migrate to Built-in Kotlin: WARNING: Your Android app project: app located at: .../app/build.gradle applies the Kotlin Gradle Plugin, which will cause build failures in future versions of Flutter. The Flutter Gradle Plugin now applies kotlin-android itself, so the `flutter create` template for 3.44 no longer lists it in the app's plugins block. Removing it here matches the template. KGP stays pinned at 2.2.20 by settings.gradle -- verified with `gradlew :app:kgpVersion`, which still reports 2.2.20 (not Flutter's bundled 2.0.0), and `:app:compileDebugKotlin` is still present in the task graph. Flutter also warned about four plugins applying KGP: desktop_webview_auth, firebase_app_check, firebase_storage, wakelock_plus wakelock_plus 1.7.0 migrated to Built-in Kotlin, so upgrading drops it from the list (constraint ^1.2.8 already allowed it; lockfile only). Of the rest: - firebase_app_check and firebase_storage already guard `apply plugin: 'kotlin-android'` behind an AGP 9 / android.builtInKotlin check. The warning is a false positive -- Flutter detects KGP with a text regex that cannot see the guard. - desktop_webview_auth 0.0.16 is the latest release and is not migrated. It arrives transitively via firebase_ui_auth -> firebase_ui_oauth, which still pins ^0.0.16, so this one needs an upstream fix. The full migration (android.builtInKotlin=true, kotlinOptions -> kotlin.compilerOptions) needs Flutter 3.47+ and AGP 9, so it is left for the next toolchain bump.
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
|
anhappdev
marked this pull request as ready for review
August 18, 2026 05:09
Contributor
|
this is supposed to resolve some of the new warnings reported by @mohitmundhragithub, #1168 |
freedomtan
reviewed
Aug 18, 2026
freedomtan
left a comment
Contributor
There was a problem hiding this comment.
LGTM.
@mohitmundhragithub you may want to take a look
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 the KGP warnings Flutter 3.44 prints on every Android build.
1. App warning — the Flutter Gradle Plugin now applies
kotlin-androiditself, and the 3.44flutter createtemplate no longer lists it in the app'spluginsblock. Removed it to match.settings.gradleunchanged, so KGP stays pinned at 2.2.20.2. Plugin warning — was
desktop_webview_auth, firebase_app_check, firebase_storage, wakelock_plus:wakelock_plus^1.2.8already allowed it, lockfile only)firebase_app_check,firebase_storageagpMajor < 9 || !builtInKotlin; Flutter's regex detector can't see the guarddesktop_webview_auth0.0.16firebase_ui_auth→firebase_ui_oauth. Needs an upstream issueThe full migration (
android.builtInKotlin=true,kotlinOptions→kotlin.compilerOptions) needs Flutter 3.47+ / AGP 9 — deferred to the next toolchain bump.Verified locally (Flutter 3.44.4 + fresh Android SDK):
:app:helpsucceeds with the app warning gone andwakelock_plusoff the plugin list;:app:kgpVersionstill reports 2.2.20 (no silent fallback to the bundled 2.0.0);:app:compileDebugKotlinstill in the task graph;flutter analyzeclean, 79 tests pass.Draft because full APK assembly can't run in my aarch64 sandbox (AGP ships x86_64-only
aapt2) — waiting on CI.