Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Invalid argument(s): Missing Library (build_runner failure)

I'm using Flutter auto_route_generator package (which is based on built_runner) to generate auto_routes.

When I run flutter packages pub run build_runner build I'm getting the above exception:

[SEVERE] auto_route_generator:autoRouteGenerator on lib/main_staging.dart (cached):

Invalid argument(s): Missing library: package:tenant_app/app/app.dart

I encountered this issue after upgrading the Flutter version from 3.0.5 to 3.3.1

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.1, on macOS 12.5.1 21G83 darwin-x64, locale en-IL)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.70.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

I tried to run the build_runner using --delete-conflicting-outputs but it didn't help

flutter packages pub run build_runner build --delete-conflicting-outputs

What is the problem? Why the build_runner is failing?

like image 929
genericUser Avatar asked Apr 28 '26 21:04

genericUser


1 Answers

Issue solved

Running the following tasks solved my issue:

  1. flutter clean
  2. flutter pub cache repair
  3. flutter pub get
  4. flutter packages pub run build_runner build --delete-conflicting-outputs

It seems that there was an issue with the cached packages after upgrading the Flutter version. Still, don't know what exactly happened.

like image 164
genericUser Avatar answered Apr 30 '26 16:04

genericUser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!