Skip to content

Update example Android build for Flutter 3.44#510

Merged
rickdijk merged 3 commits into
developfrom
chore/example-android-agp9-builtin-kotlin
Jul 20, 2026
Merged

Update example Android build for Flutter 3.44#510
rickdijk merged 3 commits into
developfrom
chore/example-android-agp9-builtin-kotlin

Conversation

@rickdijk

@rickdijk rickdijk commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Chore / build tooling update for the example Android app.

⤵️ What is the current behavior?

The example Android project uses an outdated toolchain (Gradle 7.6.3, AGP 7.3.0, Kotlin 1.7.10, Java 8). Building with Flutter 3.44 fails with:

Language version 1.4 is no longer supported; please, use version 1.8 or greater.

The example also still applies the Kotlin Gradle Plugin (kotlin-android), which Flutter warns will break in a future release.

🆕 What is the new behavior (if this is a feature change)?

  • Bumps the example Android toolchain to Gradle 9.1.0, AGP 9.0.1, Kotlin 2.3.20, and Java 17
  • Migrates the example app to AGP built-in Kotlin (kotlin.compilerOptions) per Flutter’s migration guide
  • Adds Flutter’s compatibility flags (android.builtInKotlin=false, android.newDsl=false) in gradle.properties

💥 Does this PR introduce a breaking change?

No. Changes are limited to the example Android project.

🐛 Recommendations for testing

  • From flutter_cache_manager/example, run flutter build apk --release
  • Confirm the build succeeds without the Kotlin language-version error or KGP warning

📝 Links to relevant issues/docs

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines (code style guide)
  • Relevant documentation was updated
  • Rebased onto current develop

Rick van Dijk and others added 2 commits July 19, 2026 14:10
Update Gradle, AGP, Kotlin, and Java so the example app can build with the current Flutter SDK.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove the Kotlin Gradle Plugin and use AGP's kotlin.compilerOptions DSL per Flutter's migration guide.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the example Android project’s build tooling to align with Flutter 3.44 expectations and remove reliance on the legacy Kotlin Gradle Plugin setup.

Changes:

  • Bumped Android toolchain versions (AGP/Kotlin) and updated the Gradle wrapper.
  • Updated the example app module to Java 17 and configured Kotlin via the new kotlin { compilerOptions { ... } } DSL (removing kotlin-android plugin usage).
  • Added Flutter migration compatibility flags to gradle.properties.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
flutter_cache_manager/example/android/settings.gradle Updates plugin versions for AGP and Kotlin used by the example Android build.
flutter_cache_manager/example/android/gradle/wrapper/gradle-wrapper.properties Updates Gradle wrapper distribution to a newer Gradle version.
flutter_cache_manager/example/android/gradle.properties Adds Flutter migration compatibility flags controlling built-in Kotlin/new DSL behavior.
flutter_cache_manager/example/android/app/build.gradle Removes legacy Kotlin plugin usage, sets Java 17 compatibility, and configures Kotlin compiler options via the new DSL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread flutter_cache_manager/example/android/gradle.properties
Comment thread flutter_cache_manager/example/android/app/build.gradle
@rickdijk
rickdijk merged commit 3842e57 into develop Jul 20, 2026
10 checks passed
@rickdijk
rickdijk deleted the chore/example-android-agp9-builtin-kotlin branch July 20, 2026 13:42
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.

3 participants