Skip to content

[AGP 9.1.0 Migration #10] Enable newDsl for built-in Kotlin projects - #194460

Draft
reidbaker-agent wants to merge 39 commits into
flutter:masterfrom
reidbaker-agent:agp-newdsl-default
Draft

reidbaker-agent wants to merge 39 commits into
flutter:masterfrom
reidbaker-agent:agp-newdsl-default

Conversation

@reidbaker-agent

@reidbaker-agent reidbaker-agent commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Description

PR 10 of 11 in the Flutter Gradle Plugin's AGP 9.1.0 migration (#180137, #166550).

  • What changes
    • Migration: flutter build stops adding android.newDsl=false to ready built-in Kotlin projects, and removes the marker-prefixed android.newDsl=false pair written earlier by Flutter templates or DisableNewDslMigration. Readiness (isReadyForNewDsl) requires android.builtInKotlin=true and zero newDsl-blocking constructs across scanned Gradle build scripts: root android/build.gradle(.kts), android/app/build.gradle(.kts), .android/Flutter/build.gradle(.kts) (for modules), each DeferredComponent module's build.gradle(.kts), and each native Android plugin's android/build.gradle(.kts) (falling back to .dart_tool/package_config.json on zero-plugin apps where .flutter-plugins-dependencies is absent).
    • Error handlers: when a Gradle script or plugin uses a legacy Android Gradle Plugin (AGP) extension or variant API unavailable under android.newDsl=true, or applies org.jetbrains.kotlin.android alongside android.newDsl=true, Flutter prints a Flutter Fix box naming the android.newDsl=false opt-out and the migration path (also proposed standalone in [flutter_tools] Add Gradle error handlers for android.newDsl failures #195742).
    • Deferred components: deferred-component build scripts register a per-variant @DisableCachingByDefault FlutterDeferredComponentFiles task via androidComponents.onVariants to sync per-build-mode staged Flutter outputs into per-variant generated asset and JNI source directories, compatible with android.newDsl enabled or disabled and Gradle --configuration-cache.
  • Who is affected: projects setting android.builtInKotlin=true in android/gradle.properties where every scanned Gradle build script is free of legacy AGP extension/variant APIs and unguarded kotlin-android declarations. Projects where any scanned script uses legacy AGP extension/variant APIs or unguarded kotlin-android keep android.newDsl=false. Projects whose legacy AGP API usage lives outside scanned scripts (such as buildSrc, convention plugins, or included builds) lose Flutter's marker-prefixed android.newDsl=false pair and receive the Flutter Fix box on failure.
  • User-visible output and opt-out: removing Flutter's marker-prefixed android.newDsl=false pair prints a warning naming the escape hatch. If Gradle later fails on a removed AGP API, a Flutter Fix box echoes the failing Gradle line, points to com.android.build.api.dsl and androidComponents.onVariants / beforeVariants, and gives opt-out instructions. To opt out manually, set android.newDsl=false in android/gradle.properties without # This newDsl flag was added by the Flutter template or # This newDsl flag was added automatically by Flutter migrator above the property.
  • Not affected: projects created from current templates (android.builtInKotlin=false), projects keeping android.builtInKotlin=false, and built-in Kotlin projects where any scanned app, module, deferred-component, or native Android plugin build.gradle(.kts) file blocks newDsl.
  • For reviewers: core changes live in gradle_new_dsl_scanner.dart (GradleNewDslScanner), project.dart (AndroidProject.newDslBlockingBuildFiles and appliesKotlinAndroidPlugin), disable_new_dsl_migration.dart (hasBuiltInKotlinEnabled and isReadyForNewDsl), remove_new_dsl_opt_out_migration.dart (RemoveNewDslOptOutMigration), gradle_errors.dart (kotlinAndroidPluginWithNewDslErrorHandler and legacyVariantApiErrorHandler, shared with standalone [flutter_tools] Add Gradle error handlers for android.newDsl failures #195742), and FlutterDeferredComponentFiles in the deferred-component scripts. Look hardest at token scanning and guard scoping in GradleNewDslScanner, build-file discovery in newDslBlockingBuildFiles, single-run migrator coordination in gradle.dart, error-handler patterns, and per-variant deferred-component syncing.
  • Testing: unit tests (gradle_new_dsl_scanner_test, project_test, android_project_migration_test, android_gradle_builder_test, gradle_errors_test, deferred-component unit suites), deferred-component integration tests with single and multi-flavor (free and paid) builds, four devicelab tasks, and live Gradle 9.5.0 + AGP 9.3.1 --configuration-cache verification.
  • Breaking: yes, for android.builtInKotlin=true projects whose scanned scripts pass GradleNewDslScanner while buildSrc, convention plugins, or included builds still call AGP APIs removed under android.newDsl=true.
Agent authored details

Commits

  • PR 9 ([AGP 9.1.0 Migration #9] Move aar_init_script to public AGP APIs #193962) landed on master as 1bdad40474b. 35ad2c297ad merges master 0af64498599.
  • 5980fc22918 merged PR 9 and updated both added handlers to master's ToolContext handler signature.
  • fa8ccba28db initial migrations, error handlers, deferred components, and tests.
  • aec37a05c15 AGP migration documentation updates.
  • ace704f07ce review fixes: wider kotlin-android detection, Kotlin DSL test-variant errors, static source path comment.
  • 894fd1499f7 deferred components: key staged Flutter directories by build mode.
  • b6ed66efd46 test: flavored deferred-components build.
  • 746bfcec573 deferred components: wire directories as generated sources ordered after :app:compileFlutterBuild<Variant>.
  • e7042605e05 review fixes: java.util.Properties parsing parity, wider kotlin-android forms, plugin attribution in error box, warning with escape hatch, CRLF coverage.
  • 6465a2f54e3 merges master 6597889f57b (includes e8941092c83 / Bump customer_testing to temporarily disable flame.test #194886).
  • c52b48eb8a3 gate newDsl opt-out removal on app and plugin build-file scanning; refine failure boxes.
  • acb8cd794e8 merges origin/master.
  • 09e9942c6bd Round 1 refinements: token-based build-file scanner and legacy extension error handler patterns.
  • e8a4e8e124f Round 2 refinements: extract GradleNewDslScanner, expand newDslBlockingBuildFiles across root/module/deferred-component/plugin scripts with zero-plugin package_config.json fallback, deduplicate migrator checks and single-run scans, add configuration-cache-safe per-variant FlutterDeferredComponentFiles task, sync error handlers with [flutter_tools] Add Gradle error handlers for android.newDsl failures #195742, and reconcile Android newDsl docs.

Changes

  • gradle_new_dsl_scanner.dart (added file): GradleNewDslScanner.blocksNewDsl tokenizes Groovy .gradle and Kotlin .gradle.kts scripts (handling line/block comments, single/triple-quoted strings, Groovy slashy /.../ vs division, and dollar-slashy $/.../$). Flags legacy AGP extension/variant identifiers (applicationVariants, libraryVariants, testVariants, unitTestVariants, variantFilter, BaseExtension, AppExtension, BaseAppModuleExtension, com.android.build.gradle.internal.*, and non-com.android.build.api.dsl references to LibraryExtension, TestedExtension, TestExtension), declarative plugins { ... } kotlin-android applications without apply false, and imperative kotlin-android applications (including multiline Groovy apply, map apply, and typed string variables) unless enclosed in an if (...) header checking AGP version or newDsl/builtInKotlin flags.
  • project.dart:
    • AndroidProject.appliesKotlinAndroidPlugin, extracted from isKotlin, matching imperative and declarative kotlin-android forms with escaped dots and optional version(...).
    • AndroidProject.newDslBlockingBuildFiles, scanning hostAppGradleFile, appGradleFile, .android/Flutter/build.gradle(.kts) when isModule, each DeferredComponent module's build.gradle(.kts), and native Android plugins (native_build != false) from .flutter-plugins-dependencies, with .dart_tool/package_config.json verification for zero-plugin apps. Returns null on missing/malformed plugin metadata or unreadable scripts so migrations fail closed and preserve android.newDsl=false.
  • disable_new_dsl_migration.dart:
    • Exports kNewDslTemplateMarker and kNewDslMigratorMarker.
    • hasBuiltInKotlinEnabled: parses android.builtInKotlin entries using java.util.Properties key/value rules (bare keys without separator evaluate to empty/false; last entry wins; case-insensitive true).
    • isReadyForNewDsl: requires hasBuiltInKotlinEnabled and an empty project.newDslBlockingBuildFiles list.
    • DisableNewDslMigration: skips ready projects and exposes addedOptOut so RemoveNewDslOptOutMigration skips redundant work in the same build run.
  • remove_new_dsl_opt_out_migration.dart (added file): short-circuits when DisableNewDslMigration just added the opt-out, when no kNewDslTemplateMarker / kNewDslMigratorMarker + android.newDsl=false pair is present, or when hasBuiltInKotlinEnabled is false; otherwise checks project.newDslBlockingBuildFiles once, removes the marker pair when empty, preserves line endings, and prints a warning naming the bare android.newDsl=false escape hatch.
  • gradle.dart: documents the three-migrator sequence (DisableBuiltInKotlinMigration -> DisableNewDslMigration -> RemoveNewDslOptOutMigration) and passes disableNewDslMigration into RemoveNewDslOptOutMigration.
  • gradle_errors.dart: adds kotlinAndroidPluginWithNewDslErrorHandler and legacyVariantApiErrorHandler ahead of useNewAgpDslErrorHandler (aligned with standalone PR [flutter_tools] Add Gradle error handlers for android.newDsl failures #195742), distinguishing runtime-confirmed ExtensionImpl failures from ambiguous script errors when android.newDsl=false is already active, and warning against placing Flutter's marker comments above manual android.newDsl=false entries.
  • Deferred components: deferred_component/build.gradle.tmpl, dev/integration_tests/deferred_components_test/android/component1/build.gradle, and deferred_components_config.dart define @DisableCachingByDefault FlutterDeferredComponentFiles using injected FileSystemOperations to sync per-build-mode staged directories (intermediates/flutter/<mode>/deferred_{assets,libs}) into per-variant output directories (intermediates/flutter/<variant>/deferred_{assets,libs}) wired via variant.sources.assets?.addGeneratedSourceDirectory and variant.sources.jniLibs?.addGeneratedSourceDirectory with lazy dependsOn(project(":app").tasks.matching { it.name == "compileFlutterBuild${variantName}" }).
  • Docs: Migrating-Flutter-Gradle-Plugin-to-AGP-public-API.md and website-page-draft.md match the scanner scope, migrator behavior, error handlers, and FlutterDeferredComponentFiles recipe.

Why templates keep the opt-out

With android.newDsl=true and android.builtInKotlin=false, the Flutter Gradle Plugin applies kotlin-android, and KGP 2.4.20 fails:
"The 'org.jetbrains.kotlin.android' plugin is not compatible with AGP's 9.0 new DSL (android.newDsl=true is enabled by default)."
Templates can drop android.newDsl=false only alongside flipping android.builtInKotlin to true.

Audit resolution

  • H1 (deferred components calling applicationVariants): replaced in all three deferred-component files with FlutterDeferredComponentFiles and androidComponents.onVariants. AGP 9.3.1's sourceSets { applicationVariants.all {} } failure (on source set application variants of type com.android.build.) is also matched by legacyVariantApiErrorHandler.
  • L9 (android_hardware_smoke_test BaseExtension): unaffected because GradleNewDslScanner detects BaseExtension (and android.builtInKotlin=false remains set), keeping android.newDsl=false in place.
  • JUnit template bumps: excluded from scope.

Deleted items

  • sourceSets { applicationVariants.all { ... } } blocks in packages/flutter_tools/templates/module/android/deferred_component/build.gradle.tmpl, dev/integration_tests/deferred_components_test/android/component1/build.gradle, and packages/flutter_tools/test/integration.shard/test_data/deferred_components_config.dart, replaced by FlutterDeferredComponentFiles + androidComponents.onVariants wiring per-variant generated deferred_assets and deferred_libs directories.
  • Unmarked android.newDsl=false setup in BasicDeferredComponentsConfig.androidGradleProperties (deferred_components_project.dart), updated to android.builtInKotlin=true plus # This newDsl flag was added by the Flutter template above android.newDsl=false so RemoveNewDslOptOutMigration exercises opt-out removal and android.newDsl=true builds in deferred_components_test.dart.
  • Inline Kotlin plugin regex loop in AndroidProject.isKotlin (project.dart), extracted into AndroidProject.appliesKotlinAndroidPlugin.
  • Space-splitting AAB path parsing (line.split(' ')[2]) in deferred_components_test.dart, replaced by _builtAabFromStdout regex extraction.

Behavior notes

  • Build-script scanning vs runtime fallback: built-in Kotlin apps where root, app, module, deferred-component, or native Android plugin build.gradle(.kts) scripts reference legacy AGP extension/variant APIs or unguarded kotlin-android retain android.newDsl=false without breaking. When legacy AGP API calls live in buildSrc, precompiled script plugins, or external Gradle plugins outside scanned scripts, RemoveNewDslOptOutMigration removes Flutter's marker pair and legacyVariantApiErrorHandler prints the Flutter Fix box with bare android.newDsl=false opt-out instructions.
  • Deferred components per-variant isolation & configuration cache: flutter_tools stages deferred component outputs by Flutter build mode under <component>/intermediates/flutter/<debug|profile|release>/deferred_{assets,libs}. Multi-flavor builds such as ./gradlew bundleFreeRelease bundlePaidRelease --configuration-cache share Flutter build mode release; syncing from stagedAssetsDir/stagedLibsDir (<mode>) into distinct per-variant @OutputDirectory paths (<variant.name>) prevents two tasks in one Gradle invocation from claiming identical output directories and stores/reuses Gradle's configuration cache cleanly.
  • Channel switching: older Flutter releases without isReadyForNewDsl re-add the migrator marker pair via DisableNewDslMigration; releases with RemoveNewDslOptOutMigration remove the marker pair again when ready, keeping builds working across channel switches.
  • AGP 10 timeline: AGP 9.0 release notes state: "Caution: The ability to opt-out will be removed in AGP 10.0 (mid-2026)."

Error text sample

┌─ Flutter Fix ─────────────────────────────────────────────────────────────────┐
│ [!] A Gradle build script or Gradle plugin, in the app or in a Flutter        │
│ plugin, uses an Android Gradle Plugin API unavailable when android.newDsl is  │
│ enabled.                                                                      │
│ e: file:///.../android/app/build.gradle.kts:50:9: Unresolved reference        │
│ 'applicationVariants'.                                                        │
│                                                                               │
│ Gradle identifies the build script or project under "* Where:" or "* What     │
│ went wrong:" above.                                                           │
│                                                                               │
│ To build now, set android.newDsl=false in android/gradle.properties.          │
│ Do not add "# This newDsl flag was added by the Flutter template" or "# This  │
│ newDsl flag was added automatically by Flutter migrator" above                │
│ android.newDsl=false; Flutter removes android.newDsl=false when preceded by   │
│ either comment.                                                               │
│ Android Gradle Plugin 10.0 removes the android.newDsl=false option.           │
│ For details, see:                                                             │
│ https://developer.android.com/build/releases/agp-9-0-0-release-notes#android-gradle-plugin-new-dsl │
│                                                                               │
│ If a Flutter plugin or third-party Gradle plugin uses the removed API,        │
│ upgrade the plugin or file an issue with the plugin author asking for         │
│ android.newDsl support.                                                       │
│ If the build script is in the app, migrate the build script to the            │
│ com.android.build.api.dsl interfaces and the variant API                      │
│ (androidComponents.onVariants or androidComponents.beforeVariants).           │
│ For migration instructions, see: https://developer.android.com/build/extend-agp │
└───────────────────────────────────────────────────────────────────────────────┘

Tests and matrix

  • flutter_tools analyzer (dart analyze --fatal-infos): 0 issues.
  • flutter_tools unit tests (gradle_new_dsl_scanner_test, project_test, android_project_migration_test from both packages/flutter_tools and repo root, android_gradle_builder_test, gradle_errors_test, deferred-component unit suites): all pass; 133-plugin .pub-cache scanner regression check passed.
  • Deferred-component verification:
    • Live Gradle 9.5.0 + AGP 9.3.1 + KGP 2.4.20 + JBR 21 with android.builtInKotlin=true and android.newDsl=true: back-to-back ./gradlew bundleFreeRelease bundlePaidRelease --configuration-cache stored and reused configuration cache cleanly, packaging component1/assets/flutter_assets/test_assets/asset2.txt and component1/lib/arm64-v8a/libapp.so-2.part.so in both AABs.
    • deferred_components_test, deferred_components_assets_reproduce_test, and android_obfuscate_test: pass.
  • Devicelab: build_aar_module_test, build_android_host_app_with_module_aar, build_android_host_app_with_module_source, and module_host_with_custom_build_test succeed.

Follow-ups

  • Built-in Kotlin default flip: templates drop both opt-outs.
  • In-repo test apps drop manual opt-outs and android_hardware_smoke_test migrates off BaseExtension.
  • Retire useNewAgpDslErrorHandler once AGP 10 removes android.newDsl=false.
  • Refine FlutterPluginUtils.kt KGP classpath diagnostic wording.

Pre-landing checklist (breaking change)

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

The application path of the Flutter Gradle Plugin no longer uses the
deprecated BaseVariant API (applicationVariants / ApkVariantOutput):

- CopyFlutterApksTask copies the variant's SingleArtifact.APK outputs,
  read through BuiltArtifactsLoader, into build/outputs/flutter-apk under
  the unchanged names app[-abi][-flavor]-<mode>.apk. assemble<Variant>
  depends on it. The task has no Project or variant fields and uses an
  injected FileSystemOperations.
- A single naming function in the task produces both the declared
  @OutputFiles and the copied file names. Its inputs are the ABIs of the
  variant's outputs (what AGP builds), the flavor, and the build mode.
  The task fails if AGP built an APK for an ABI that was not declared.
- Per-ABI versionCode for --split-per-abi is a read-then-set on
  VariantOutput.versionCode in onVariants. This is a documented
  exception to the no-configuration-time-get rule, because the lazy
  form is circular. The read relies on AGP's compatibility mode
  (android.compatibility.enableLegacyApi, on by default through 9.x).
- The applicationVariants.configureEach block and its
  @Suppress("DEPRECATION") markers are deleted. The add-to-app module
  path keeps using libraryVariants until the next phase.

Behavior change: Flutter's onVariants callback runs before an app's own
androidComponents.onVariants block, while ApkVariantOutput's
versionCodeOverride was applied after it. Apps that transform
output.versionCode there transform Flutter's offset value (for example
arm64-v8a, build 42, x10000: 422000 -> 20420000). The migration doc and
the breaking-change page draft describe this and give a recipe that
keeps the 422000-style numbers. No divergence warning is emitted,
because it would fire on the onVariants pattern that AGP recommends.

Part of flutter#166550.
…ures

- Take the per-ABI versionCode base from a finalizeDsl snapshot of the
  DSL versionCodes (DslVersionCodes) instead of reading
  output.versionCode, which AGP rejects during configuration when
  android.compatibility.enableLegacyApi=false. Warn and skip when the
  DSL declares no versionCode.
- Add a strict-mode (enableLegacyApi=false) case to
  flutter_build_apk_split_per_abi_test.
- CopyFlutterApksTask: use Gradle's Copy/Sync caching annotation and
  reason; explain when the metadata can be missing and when the ABI
  check can fail; point both errors at the plugin that transforms
  SingleArtifact.APK instead of asking for a Flutter issue.
- Document what an APK transform must keep in website-page-draft.md.
- Link the website-page-draft.md references to tracking issue flutter#193713.
- Remove temporal wording from KDoc and docs.
Add-to-app module (library) variants use the same androidComponents.onVariants
path as application variants: the compile, assets and jniLibs tasks are
registered lazily per library variant, and the assets and native libraries are
generated source directories of the variant. The host app consumes them like
any Android library.

Deletes the host-project lookup, the libraryVariants x applicationVariants
cross-wiring, the merge<HostVariant>Assets.dependsOn edge,
addFlutterDepsForModule, addCopyFlutterAssetsDependency,
shouldConfigureFlutterTask(Project, Task) and
buildModeFor(com.android.builder.model.BuildType).

flutter.hostAppProjectName has no effect and logs a warning.

The jniLibs copy is wired from the compile task provider, so its input
directory is required in both copy tasks.
…er comments

- CopyFlutterApksTask: state why caching is disabled (local copy; a cache
  entry would duplicate the APKs) and build both errors through one
  transformedApkError helper.
- Trim comments and KDoc added by this PR to what the code does not
  already say.
…er-agent/flutter into agp-add-to-app-module

# Conflicts:
#	packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt
#	packages/flutter_tools/gradle/src/main/kotlin/FlutterPluginUtils.kt
Keep only what the code doesn't say: why library variants are not
gated by the command line, why the copy task inputs are required, and
what the tests guard. Restore PR 7's shouldCompileFlutterForVariant
paragraph verbatim.
Explain why library variants skip the command-line gate, drop the
application/library list from the assets comment, drop the 'public
variant API' clause, and say what library variants lack in
configureApplicationOutputs.
…m_build_test

The devicelab test already builds the same host fixture one task at a
time. Add a debuggable qa build type that falls back to the module's
release variant, and a final section that builds it with
android.newDsl=true and flutter.hostAppProjectName set. It checks the
warning and that the APK has release Flutter artifacts.

Delete android_add_to_app_module_test.dart, which duplicated that
setup.
Add stubTaskRegistration, captureTaskConfiguration and
setCommandLineTasks, and use them in the add-to-app onVariants tests.
Branch on the variant type at the call site so the function receives an
ApplicationVariant and needs no check().
…a section

AGP 9.1 and 9.3 deprecate the option. Its consumers back the variant API
that android.newDsl=true already removes.
The flutter tool runs Gradle with -q, which hides logger.warn. Log the
warning with logger.error, as the plugin's other user-facing warnings
do, and state the consequence (Google Play needs a distinct versionCode
per APK) and the fix.
flutter build aar failed on a module with android.newDsl=true: the
library check read android.libraryVariants, which AGP does not create
with the new DSL ("Can't generate AAR on a non Android library
project."), and the plugin wiring read it again.

- Detect a library project with pluginManager.hasPlugin(
  "com.android.library").
- Declare singleVariant publishing for each variant, and keep a
  declaration that the project's build file already made. AGP's
  duplicate-declaration error is matched by its message, because its
  class is not public AGP API. This replaces the read of AGP's internal
  publishing.singleVariants, which skipped Flutter's declarations for
  every variant once the build file declared any, so a module that
  declared only release failed every flutter build aar.
- Remove the module-to-plugin assembleAar<Variant> dependsOn. The tool
  requests the task by name, so Gradle runs it in every project that
  has it and each plugin publishes its own AAR.
- When an Android plugin has no variant with the requested name
  (different product flavors), fail with an error that names the plugin,
  instead of "Task with name 'assembleAar<Variant>' not found".
- devicelab build_aar_module_test builds with android.newDsl=true and a
  module singleVariant("release") declaration.
- Update the migration doc and the website page draft.
The tool requests assembleAar<Variant> without a project path, so Gradle
skips projects that lack it. Check each requested task against the module
and every Android plugin, so a flavor mismatch in either direction fails
instead of reporting success with an incomplete repo. Cover both errors in
build_aar_module_test and scope the doc claims about the deleted code.
…AR tasks lazily

- checkProjectsHaveRequestedVariants compares the requested task names
  with aarTaskName() of each project's publishing components, so no task
  name is parsed back into a variant name. Its doc says when it returns
  and when it throws.
- aarComponents() is the one component filter for task registration and
  the check.
- addAarTask registers its task lazily. The publication is created
  outside the task's configuration action, where maven-publish may
  register its tasks.
- Link AGP's checkSingleVariantUniqueness source (AGP 9.1.0 tag) and say
  why the duplicate error is identified.
- Keep the task-selector explanation once, in projectsEvaluated.
- Docs describe only the behavior.
- checkProjectsHaveRequestedVariants: a requested task that matches no
  project's variant is left to Gradle's task selector error.
- aarComponents: describe what the filter returns.
- addAarTask: state the effect of the requested-task guard, and drop the
  "all" note from the publication comment (the filter is in aarComponents).
…add-to-app-module

# Conflicts:
#	packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt
#	packages/flutter_tools/gradle/src/main/kotlin/FlutterPluginUtils.kt
#	packages/flutter_tools/gradle/src/test/kotlin/FlutterPluginTest.kt
Drop the "all" component filter. AGP 7.x and lower created an automatic
"all" component only when the project used no publishing DSL; this script
declares singleVariant for every variant, and AGP 8.0+ has no automatic
components. Describe what AGP creates for singleVariant, and select the
requested components in the caller so addAarTask no longer returns early.
Registering only the requested task drops Gradle's candidate list
('Some candidates are: assembleAarDebug, ...') from the error for a
misspelled --flavor. Register a task for each component, as before, and
keep the requested-component filter for publications only.
…ant API errors

- DisableNewDslMigration skips projects whose gradle.properties sets
  android.builtInKotlin=true and whose app does not apply kotlin-android.
- RemoveNewDslOptOutMigration removes the Flutter-written newDsl marker
  pair from those projects only.
- legacyVariantApiErrorHandler and kotlinAndroidPluginWithNewDslErrorHandler
  match errors reproduced with AGP 9.3.1 and KGP 2.4.20.
- The deferred component template, its in-repo test app and the
  integration test fixture use androidComponents.onVariants instead of
  applicationVariants.
…nt errors, comment on the static source path
@github-actions github-actions Bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Oct 15, 2026
…on, plugin scripts in the error and docs, warning with escape hatch

- builtInKotlin values keep trailing whitespace, as java.util.Properties
  does, so 'true ' is not true (matches the Flutter Gradle Plugin).
- kotlin-android detection accepts a version suffix and the
  libs.plugins.jetbrains.kotlin.android alias; apply false is not applied.
- The legacy variant API error says the script may belong to a plugin and
  points at Gradle's '* Where:' line.
- The opt-out removal prints a warning that names the bare-flag escape hatch.
- Source comments name the Gradle, AGP and KGP versions each pattern matches.
- The CRLF test asserts the exact output.
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Oct 20, 2026
@reidbaker reidbaker added the CICD Run CI/CD label Oct 20, 2026
The Flutter tool writes deferred component files under
intermediates/flutter/<debug|profile|release>. Keying the directories by
variant name missed them for custom build types and flavored variants.
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Oct 20, 2026
@reidbaker reidbaker added the CICD Run CI/CD label Oct 20, 2026
The app and the dynamic feature module declare a free flavor, so the
variant name (freeRelease) differs from the Flutter build mode (release).
With variant-name keying the component's libapp.so part is missing from
the bundle.
@github-actions github-actions Bot removed the platform-android Android applications specifically label Oct 20, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Oct 20, 2026
@reidbaker reidbaker added the CICD Run CI/CD label Oct 20, 2026
… sources

The directories are filled by the app's compileFlutterBuild<Variant> task,
but nothing ordered the component's merge tasks after it. A task with no
actions declares them as outputs, depends on the app's Flutter task, and
is passed to addGeneratedSourceDirectory, which also removes the
configuration-time .get() on the build directory.
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Oct 20, 2026
@reidbaker reidbaker added the CICD Run CI/CD label Oct 20, 2026
@reidbaker

Copy link
Copy Markdown
Member

@jesswrd same here not human reviewed yet.

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Oct 29, 2026
@github-actions github-actions Bot removed the platform-android Android applications specifically label Oct 29, 2026
@reidbaker reidbaker added the CICD Run CI/CD label Oct 30, 2026
…ents, and error handlers

Extracts GradleNewDslScanner, expands AndroidProject.newDslBlockingBuildFiles across root/module/deferred-component/plugin Gradle files with zero-plugin package_config.json fallback, deduplicates newDsl migrator checks and single-run scans, migrates deferred component templates and fixtures to configuration-cache-safe androidComponents tasks, syncs Gradle error handlers, and reconciles Android newDsl documentation.
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

d: docs/ flutter/flutter/docs, for contributors team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants