Skip to content

flutter build doesn't include assets added to a path dependency in between builds #141626

@johnpryan

Description

@johnpryan

If you are working on a package with an example/ directory, you usually declare the parent folder as a package dependency. Making changes to the package assets and running flutter build web in the consumer package (example/) won't include the assets in the build. I needed to run flutter clean followed by flutter build web to see the assets included in my build folder.

Steps to reproduce

  1. Create a Flutter package
  2. Create new Flutter app example/
  3. Run flutter build web in example/
  4. Add an asset to pubspec.yaml in the parent package:
flutter:
  assets:
    - lib/my_script.js
  1. Run flutter build web in example/
  2. Observe build/web/assets/ directory doesn't contain the new asset
  3. Run flutter clean
  4. (edit by @andrewkolos) Run flutter build web again
  5. Observe the build/web/assets directory now contains the asset

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: assetsPackaging, accessing, or using assetsa: buildBuilding flutter applications with the toolfound in release: 3.19Found to occur in 3.19found in release: 3.20Found to occur in 3.20has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions