flutter_gen icon indicating copy to clipboard operation
flutter_gen copied to clipboard

[Bugs] File not generated

Open ariefwijaya opened this issue 3 years ago • 5 comments

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: image

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)

ariefwijaya avatar Jun 06 '22 06:06 ariefwijaya

I had the same problem. Fixed by flutter clean

IlyaMax avatar Jun 06 '22 15:06 IlyaMax

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 avatar Jun 07 '22 05:06 ariefwijaya

@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?

IlyaMax avatar Jun 07 '22 09:06 IlyaMax

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.

wasabeef avatar Jun 07 '22 09:06 wasabeef

@IlyaMax Because the thing is about my configuration in build.yaml not plugin

ariefwijaya avatar Jun 09 '22 03:06 ariefwijaya