[flutter_tools] Migrate detectLowCompileSdkVersionOrNdkVersion to AGP task#184731
Conversation
… task Migrates the evaluation of detectLowCompileSdkVersionOrNdkVersion from project.afterEvaluate to a modern Android Gradle Plugin (AGP) task-based approach.
There was a problem hiding this comment.
Code Review
This pull request refactors the Android SDK and NDK version validation logic into a dedicated Gradle task, ValidateCompileSdkVersionTask, which is now wired to run before the preBuild task. The changes include migrating the validation logic from FlutterPluginUtils and updating the test suite accordingly. Feedback was provided to improve Gradle performance by adhering to the Task Configuration Avoidance API, specifically by configuring the task lazily instead of forcing immediate realization.
|
Leaving in draft until tests pass. |
- Applied ktlint formatting using CI configuration - Used editorconfig and ktlint-baseline from dev/bots/test/analyze-test-input - Validated all changes pass ktlint checks
…ment on github for ways to resolve false positives
There was a problem hiding this comment.
Code Review
This pull request refactors the Android SDK and NDK version validation logic by introducing a new 'ValidateCompileSdkVersionTask' and removing the legacy 'logPluginCompileSdkWarnings' and 'logPluginNdkWarnings' methods from 'FlutterPluginUtils'. The review identified several critical issues: missing imports for 'AndroidComponentsExtension', potential NullPointerExceptions when accessing Android extensions, and the need to restore default NDK version handling to prevent runtime crashes.
…ce and configuration cache compatible
|
An existing Git SHA, To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with |
| val name = requireNotNull(plugin["name"] as? String) { "Missing valid \"name\" property for plugin object: $plugin" } | ||
| val pluginProject = project.rootProject.findProject(":$name") | ||
| if (pluginProject != null) { | ||
| val androidExtensionWrapper = |
There was a problem hiding this comment.
Should this be pluginAndroidExtension and the existing extension be projectAndroidExtension ? The current naming makes it seem like one is a wrapper and one is the direct object
but these are just actually both the direct object right, just for the different projects
…11713) Manual roll requested by [email protected] flutter/flutter@23f6f58...0541913 2026-05-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Windows] Propagate the enabled accessibility state (#184501)" (flutter/flutter#186492) 2026-05-13 [email protected] [dev] Use super parameters in missed spots (flutter/flutter#186193) 2026-05-13 [email protected] [Windows] Propagate the enabled accessibility state (flutter/flutter#184501) 2026-05-13 [email protected] [flutter_tool] filter out MotionEvent-JNI warning spam from logcat (#174783) (flutter/flutter#186079) 2026-05-13 [email protected] Roll Packages from 93cbed6 to 2ec2236 (1 revision) (flutter/flutter#186464) 2026-05-13 [email protected] [web] Fix untriaged issues link label (flutter/flutter#186465) 2026-05-13 [email protected] [Impeller] Namespace user-supplied shaders to prevent entrypoint collisions (flutter/flutter#186332) 2026-05-13 [email protected] [flutter_tools] Migrate detectLowCompileSdkVersionOrNdkVersion to AGP task (flutter/flutter#184731) 2026-05-13 [email protected] Update the Flutter Gallery web app template files to support running with Wasm (flutter/flutter#186268) 2026-05-13 [email protected] [web] Use heap allocation for buffers that would consume too much space on the Wasm stack (flutter/flutter#186228) 2026-05-13 [email protected] Roll Skia from 56ca5896c0d9 to 27f7bba22600 (3 revisions) (flutter/flutter#186444) 2026-05-13 [email protected] Roll Fuchsia Linux SDK from z7ICmPtn4hspu02zk... to y6uQHA5xUN83IF395... (flutter/flutter#186442) 2026-05-13 [email protected] Roll Skia from 6385958d2feb to 56ca5896c0d9 (1 revision) (flutter/flutter#186441) 2026-05-13 [email protected] Roll Dart SDK from 9576691c37d8 to 8e30b88e4d5a (1 revision) (flutter/flutter#186429) 2026-05-13 [email protected] Roll Skia from 77a21bc723dc to 6385958d2feb (9 revisions) (flutter/flutter#186428) 2026-05-13 [email protected] Docs/improving docs for semantics UI lib (flutter/flutter#186125) 2026-05-12 [email protected] [Tool] Support glob patterns when parsing workspaces in FlutterProject (flutter/flutter#185715) 2026-05-12 [email protected] docs: fix overriden -> overridden in MediaQueryData dartdoc (flutter/flutter#186323) 2026-05-12 [email protected] [Test cross imports] No material in `test/foundation`, `test/gestures`, `test/semantics`, `test/services` (flutter/flutter#186144) 2026-05-12 [email protected] docs: fix "tha" -> "that" typo in widget_inspector_test comment (flutter/flutter#186322) 2026-05-12 [email protected] docs: Fix doubled-word typos in framework dartdoc (flutter/flutter#186319) 2026-05-12 [email protected] Roll pub packages (flutter/flutter#186418) 2026-05-12 [email protected] Bumped required mediatek vender sdk version. (flutter/flutter#186405) 2026-05-12 [email protected] Make DeepLinkJsonFromManifestTask Gradle task build cacheable (flutter/flutter#185903) 2026-05-12 [email protected] Harden dev tooling scripts against command injection and log leaks (flutter/flutter#186076) 2026-05-12 [email protected] Roll pub packages (flutter/flutter#186274) 2026-05-12 [email protected] [Flutter GPU] Allow allocating multi-mip textures and overwriting specific (mip, slice) levels (flutter/flutter#185890) 2026-05-12 [email protected] [web] Fix MenuAnchor dismiss when semantics enabled (flutter/flutter#183093) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#11713) Manual roll requested by [email protected] flutter/flutter@23f6f58...0541913 2026-05-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Windows] Propagate the enabled accessibility state (#184501)" (flutter/flutter#186492) 2026-05-13 [email protected] [dev] Use super parameters in missed spots (flutter/flutter#186193) 2026-05-13 [email protected] [Windows] Propagate the enabled accessibility state (flutter/flutter#184501) 2026-05-13 [email protected] [flutter_tool] filter out MotionEvent-JNI warning spam from logcat (#174783) (flutter/flutter#186079) 2026-05-13 [email protected] Roll Packages from 93cbed6 to 2ec2236 (1 revision) (flutter/flutter#186464) 2026-05-13 [email protected] [web] Fix untriaged issues link label (flutter/flutter#186465) 2026-05-13 [email protected] [Impeller] Namespace user-supplied shaders to prevent entrypoint collisions (flutter/flutter#186332) 2026-05-13 [email protected] [flutter_tools] Migrate detectLowCompileSdkVersionOrNdkVersion to AGP task (flutter/flutter#184731) 2026-05-13 [email protected] Update the Flutter Gallery web app template files to support running with Wasm (flutter/flutter#186268) 2026-05-13 [email protected] [web] Use heap allocation for buffers that would consume too much space on the Wasm stack (flutter/flutter#186228) 2026-05-13 [email protected] Roll Skia from 56ca5896c0d9 to 27f7bba22600 (3 revisions) (flutter/flutter#186444) 2026-05-13 [email protected] Roll Fuchsia Linux SDK from z7ICmPtn4hspu02zk... to y6uQHA5xUN83IF395... (flutter/flutter#186442) 2026-05-13 [email protected] Roll Skia from 6385958d2feb to 56ca5896c0d9 (1 revision) (flutter/flutter#186441) 2026-05-13 [email protected] Roll Dart SDK from 9576691c37d8 to 8e30b88e4d5a (1 revision) (flutter/flutter#186429) 2026-05-13 [email protected] Roll Skia from 77a21bc723dc to 6385958d2feb (9 revisions) (flutter/flutter#186428) 2026-05-13 [email protected] Docs/improving docs for semantics UI lib (flutter/flutter#186125) 2026-05-12 [email protected] [Tool] Support glob patterns when parsing workspaces in FlutterProject (flutter/flutter#185715) 2026-05-12 [email protected] docs: fix overriden -> overridden in MediaQueryData dartdoc (flutter/flutter#186323) 2026-05-12 [email protected] [Test cross imports] No material in `test/foundation`, `test/gestures`, `test/semantics`, `test/services` (flutter/flutter#186144) 2026-05-12 [email protected] docs: fix "tha" -> "that" typo in widget_inspector_test comment (flutter/flutter#186322) 2026-05-12 [email protected] docs: Fix doubled-word typos in framework dartdoc (flutter/flutter#186319) 2026-05-12 [email protected] Roll pub packages (flutter/flutter#186418) 2026-05-12 [email protected] Bumped required mediatek vender sdk version. (flutter/flutter#186405) 2026-05-12 [email protected] Make DeepLinkJsonFromManifestTask Gradle task build cacheable (flutter/flutter#185903) 2026-05-12 [email protected] Harden dev tooling scripts against command injection and log leaks (flutter/flutter#186076) 2026-05-12 [email protected] Roll pub packages (flutter/flutter#186274) 2026-05-12 [email protected] [Flutter GPU] Allow allocating multi-mip textures and overwriting specific (mip, slice) levels (flutter/flutter#185890) 2026-05-12 [email protected] [web] Fix MenuAnchor dismiss when semantics enabled (flutter/flutter#183093) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Migrates the evaluation of detectLowCompileSdkVersionOrNdkVersion from project.afterEvaluate to a modern Android Gradle Plugin (AGP) task-based approach.
Fixes #184415
Pre-launch Checklist
///).