flutter_gen
flutter_gen copied to clipboard
[Bugs] File not generated
I was trying to generate assets by running flutter pub run build_runner build --delete-conflicting-outputs , success without any error but no file has been generated.
this is part of my pubspec:
environment:
sdk: ">=2.7.0 <3.0.0"
dev_dependencies:
build_runner: ^2.1.11
flutter_gen_runner: ^4.2.1
flutter:
uses-material-design: true
assets:
- assets/image/brand_deals/status/success.png
- assets/image/brand_deals/status/fail.png
flutter_gen:
output: lib/constant/
And this is my assets folder:

Logs:
INFO] Generating build script... [INFO] Generating build script completed, took 570ms [INFO] Precompiling build script...... [INFO] Precompiling build script... completed, took 5.4s [INFO] Initializing inputs [INFO] Building new asset graph... [INFO] Building new asset graph completed, took 613ms [INFO] Checking for unexpected pre-existing outputs.... [INFO] Deleting 3 declared outputs which already existed on disk. [INFO] Checking for unexpected pre-existing outputs. completed, took 5ms [INFO] Running build... [INFO] Generating SDK summary... [INFO] 3.3s elapsed, 0/2 actions completed. [INFO] Generating SDK summary completed, took 3.3s [INFO] 4.4s elapsed, 0/2 actions completed. [INFO] 5.6s elapsed, 2/7 actions completed. [INFO] 6.6s elapsed, 2/7 actions completed. [INFO] 12.3s elapsed, 2/7 actions completed. [INFO] 13.3s elapsed, 238/240 actions completed. [INFO] Running build completed, took 13.5s [INFO] Caching finalized dependency graph... [INFO] Caching finalized dependency graph completed, took 92ms [INFO] Succeeded after 13.6s with 12 outputs (310 actions)
I had the same problem. Fixed by flutter clean
Problem Solved, but not with flutter clean, In my case, the problem happened because I put this in build .yaml
flutter_gen_runner:
enabled: false
generate_for:
include:
- pubspec.yaml
I'm closing this, thanks.
@ariefwijaya why you closed? I think it'd better if @wasabeef did this. I don't have these lines in my project but I had to clean project to regenerate still. Is it normal behavior?
Since v4.2.0, the cache is enabled for build_runner watch, so this is the correct behavior on build_runner. (I didn't use the cache before v4.1.6.)
However, it's troublesome to execute the clean command, so I am thinking about how to fix with.
@IlyaMax Because the thing is about my configuration in build.yaml not plugin