fix(mobile): align Android AGP/Gradle/Kotlin with Flutter 3.41.7 (unbreak Android build)#1775
Open
AaronGoldsmith wants to merge 1 commit into
Open
Conversation
The Android build has been broken on main since 2026-05-20. Renovate bumped the Android Gradle Plugin to v9 (block#674) and Gradle to v9 (block#672), but the pinned Flutter version (3.41.7) does not support AGP 9. The Flutter Gradle plugin fails to apply under AGP 9's new DSL, and third- party plugins that still apply `kotlin-android` (e.g. app_badge_plus) collide with AGP 9's built-in Kotlin. Realign the three version pins to the defaults Flutter 3.41.7 ships in its own project templates (flutter_tools/lib/src/android/gradle_utils.dart): - AGP: 9.2.1 -> 8.11.1 - Gradle: 9.5.1 -> 8.14 - Kotlin: 2.3.21 -> 2.2.20 With these, `flutter run` builds and launches on a physical device. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Aaron Goldsmith <aargoldsmith@gmail.com>
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.
What
Realigns the Android build's AGP / Gradle / Kotlin versions to the defaults that our pinned Flutter (3.41.7) actually supports:
Three lines across
settings.gradle.ktsandgradle-wrapper.properties.Why
The Android build has been broken on
mainsince 2026-05-20. Two Renovate PRs bumped the Android toolchain a full major version ahead of what Flutter 3.41.7 supports:com.android.application(AGP) → v9Under AGP 9,
flutter runfails in a chain of ways:kotlin-androidplugin "no longer required since AGP 9.0" (built-in Kotlin).NullPointerExceptionbecause AGP 9 "only reads the new DSL."kotlin-android(e.g.app_badge_plus) collide with built-in Kotlin: "Cannot add extension with name 'kotlin', as there is an extension already registered."The chosen versions aren't arbitrary — they're the exact template defaults this Flutter ships, from
flutter_tools/lib/src/android/gradle_utils.dart:Testing
flutter runbuilds and launches on a physical device (Pixel 3a XL, Android withtargetSdk36) — previously it failed atassembleDebug.just mobile-checkpasses (dart format +flutter analyze: no issues).Notes / caveats
mobilejob (.github/workflows/ci.yml) runsflutter pub get, format check,flutter analyze, andflutter test, but no Android Gradle /assembleDebugbuild. Suggested follow-up: an AndroidassembleDebugsmoke build in CI, and/or Renovate constraints holding AGP/Gradle back until Flutter supports those majors.