Skip to content

Asset flavor bundling emits a noisy per-file warning for every file in non-active flavor directories #186738

Description

@qeepcologne

Steps to reproduce

  1. Declare multi-flavor asset directories in pubspec.yaml:
flutter:
  assets:
    - path: assets/flavour1/
      flavors: [flavour1]
    - path: assets/flavour2/
      flavors: [flavour2]
    - path: assets/flavour3/
      flavors: [flavour3]
    - path: assets/flavour4/
      flavors: [flavour4]
  1. Place at least one file inside each directory (placeholder, image, SVG, ...).
  2. Build a single flavor: flutter build apk --flavor flavour1

Actual results

Starting in Flutter 3.44, the build logs, at default verbosity, one warning per file in every non-active flavor directory:

Skipping assets entry "assets/flavour2/<file>" since its configured flavor(s) did not match the provided flavor (if any).
Configured flavors: flavour2

Skipping assets entry "assets/flavour3/<file>" since its configured flavor(s) did not match the provided flavor (if any).
Configured flavors: flavour3

Skipping assets entry "assets/flavour4/<file>" since its configured flavor(s) did not match the provided flavor (if any).
Configured flavors: flavour4

This scales linearly with the number of files across inactive flavor directories. Hundreds of files → hundreds of warning lines on every build.

Expected results

Skipping is the documented, declared, intended behavior. From the Flutter flavor asset bundling docs:

If you have assets that are only used in a specific flavor in your app, you can configure them to only be bundled into your app when launching that flavor.

The message restates exactly that configuration back to the developer; it isn't actionable. Suggested options:

  • Drop entirely.
  • Demote to -v / verbose only.
  • Collapse to one line per directory rather than per file.

Flutter doctor

  • Introduced in Flutter 3.44 (not present in 3.41.x).
  • Reproducible on Android and iOS (--flavor is not supported on web).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions