Skip to content

fix: bump Android compileSdk to 36 across all plugins for AGP 9 compatibility#873

Merged
fbernaly merged 2 commits into
flutter-ml:developfrom
pierrejean75:fix/face-detection-compilesdk-36
Jun 8, 2026
Merged

fix: bump Android compileSdk to 36 across all plugins for AGP 9 compatibility#873
fbernaly merged 2 commits into
flutter-ml:developfrom
pierrejean75:fix/face-detection-compilesdk-36

Conversation

@pierrejean75

@pierrejean75 pierrejean75 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Problem

Under Android Gradle Plugin 9, the strict checkDebugAarMetadata task fails the build when a plugin module compiles against an Android SDK older than what its (transitive) dependencies require — e.g. the Google native ML Kit AARs now require compileSdk 36. This blocks any app building on AGP 9 (Flutter's upcoming default).

Fix

Bump compileSdk from 35 to 36 across all plugin Android modules in the monorepo (22 packages, including google_mlkit_commons). Build-configuration only — no source or public API changes.

Updated per review (@fbernaly: bump the rest of the plugins; @Copilot: google_mlkit_commons was still at 35 in-repo — now bumped too).

Environment

  • Flutter 3.44 (stable), AGP 9.x, Gradle 9.x, JDK 21

@fbernaly

fbernaly commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

@pierrejean75 : could you bump the rest of the plugins as well as part of this PR? and make sure to test with the example app.

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 Android build configuration for google_mlkit_face_detection to avoid AGP 9 checkDebugAarMetadata failures by compiling against a newer Android SDK level.

Changes:

  • Bump compileSdk for google_mlkit_face_detection Android module from 35 to 36.

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

namespace = "com.google_mlkit_face_detection"

compileSdk = 35
compileSdk = 36

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@pierrejean75 ^^ address this as well

@pierrejean75 pierrejean75 changed the title fix(face_detection): bump Android compileSdk to 36 for AGP 9 compatibility fix: bump Android compileSdk to 36 across all plugins for AGP 9 compatibility Jun 8, 2026
@pierrejean75

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review! Updated:

  • Bumped compileSdk 35 → 36 across all plugin Android modules in one commit (22 packages).
  • Included google_mlkit_commons — good catch @Copilot, the repo still had it at 35, so the alignment is now real in-tree (not just relative to the published AAR).

On testing with the example app: this is a build-config-only change (compileSdk only sets the compilation target; no source/API changes), and every module now uniformly targets 36 to match the Google native AARs. I haven't been able to run the full example matrix in my environment yet — happy to add example build results, or defer to CI if that already covers it.

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

Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.

@fbernaly fbernaly merged commit be030b4 into flutter-ml:develop Jun 8, 2026
3 checks passed
@pierrejean75

Copy link
Copy Markdown
Contributor Author

Thank you @fbernaly for the quick review and merge! 🙏 Much appreciated — great to see the whole monorepo aligned on compileSdk 36 ahead of AGP 9. Looking forward to the pub.dev release.

@fbernaly

fbernaly commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

For now pull the code hardcoding your yaml pointing to the repo. I do not have an ETA for the next release. I am trying to resolve some issues with SPM before releasing a new version.

@pierrejean75

Copy link
Copy Markdown
Contributor Author

Thanks @fbernaly, much appreciated — and thanks for merging it into develop. Understood on the release timing; no problem, I'll point my pubspec at the develop branch via a git dependency override in the meantime and switch back to a pub.dev version once you cut the next release (good luck with the SPM work). Happy to help test a release candidate if that's useful.

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