Skip to content

fix: update Gradle 8.12 + AGP 8.9.1 for JDK 23+ compat#2873

Open
GhagSagar23 wants to merge 2 commits into
flutter:mainfrom
GhagSagar23:fix/update-gradle-agp-jdk23
Open

fix: update Gradle 8.12 + AGP 8.9.1 for JDK 23+ compat#2873
GhagSagar23 wants to merge 2 commits into
flutter:mainfrom
GhagSagar23:fix/update-gradle-agp-jdk23

Conversation

@GhagSagar23

Copy link
Copy Markdown

Summary

Updates all 22 Android sample directories to Gradle 8.12 and AGP 8.9.1, fixing builds on JDK 23+.

Changes per sample category:

  • All 22 samples: gradle-wrapper.properties → Gradle 8.12-all
  • 6 hybrid Flutter samples (animations, form_app, navigation_and_routing, platform_channels, platform_design, asset_transformation): AGP 7.3.0 → 8.9.1 in settings.gradle, added Kotlin 2.1.0 plugin, removed redundant buildscript block from build.gradle
  • 5 old-style Flutter samples (google_maps, material_3_demo, simple_shader, testing_app, pedometer/example): full migration from buildscript/apply plugin to pluginManagement + plugins {} DSL, added namespace, removed package= from AndroidManifest.xml
  • 2 native add_to_app samples (books/android_books, fullscreen/android_fullscreen): AGP → 8.9.1, Kotlin → 1.8.22, apply pluginplugins {}, added namespace where missing, compileSdk/targetSdk → 36
  • 1 Flutter plugin (pedometer/android): AGP 7.3.0 → 8.9.1, added namespace

Why Gradle 8.12 + AGP 8.9.1:

  • Gradle 7.x caps at JDK 18-19; JDK 23 produces Unsupported class file major version 67
  • Gradle 8.12 supports JDK 23+
  • AGP 8.9.1 is the latest stable compatible with Gradle 8.12
  • AGP 8.x requires namespace in build.gradle (removed from AndroidManifest.xml)

Test plan

  • Ran dart tool/ci_script.dart — all packages pass (2 pre-existing failures unrelated to this change: compass_app/server and cupertino_gallery)
  • Verified no formatting regressions (dart format clean)
  • Verified no analysis issues (dart analyze clean)

Fixes #2568

GhagSagar23 and others added 2 commits July 17, 2026 23:10
All 22 android sample dirs migrated:
- gradle-wrapper → 8.12-all
- AGP 7.3.0 → 8.9.1
- namespace added where missing (AGP 8.x requirement)
- package= removed from AndroidManifest.xml
- old-style buildscript/apply-plugin → plugins {} DSL where applicable

Fixes flutter#2568
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.

Many samples use old Gradle, impossible to build on modern JDK

1 participant