8
votes

I'm having issue running the

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

The command does not go in error, but it's stuck on the first file:

WARNING] No actions completed for 15.0s, waiting on:
  - auto_route_generator:autoRouteGenerator on lib/ui/shared/ui_helpers.dart
  - auto_route_generator:autoRouteGenerator on lib/ui/views/settings/settings_datamodel.dart
  - auto_route_generator:autoRouteGenerator on lib/ui/views/settings/settings.dart
  - auto_route_generator:autoRouteGenerator on lib/ui/views/review_invitation/review_invitation_datamodel.dart
  - auto_route_generator:autoRouteGenerator on lib/ui/views/review_invitation/review_invitation.dart
  .. and 9 more

[INFO] 1m 17s elapsed, 1/15 actions completed.

The following is my pubspec:

dependencies:
  flutter:
    sdk: flutter

  # see below for explanation
  stacked_services:
  auto_route:
  stacked: ^1.7.6
  stacked_hooks: 0.1.1+3
  flutter_hooks:
  get_it:
  injectable:
  validators: ^2.0.0 

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.3

dev_dependencies:
  flutter_test:
    sdk: flutter

  build_runner:
  auto_route_generator:
  injectable_generator:

While this is the class for my router.dart

import 'package:auto_route/auto_route_annotations.dart';
import 'package:myapp/ui/views/StartupView.dart';

@MaterialAutoRouter(
  routes: <AutoRoute>[
    MaterialRoute(page: StartupView, initial: true),
  ],
)
class $Router {}

Any advices?

4
1: flutter clean 2: flutter doctor -v 3. try for build againShailesh Bhokare
it's still stuck. I don't know why it doesn't workxcsob

4 Answers

9
votes

A flutter pub upgrade solved my issue.

1
votes

method-1: if after upgrade flutter this issue happened try run:

flutter packages upgrade then flutter pub run build_runner build


method-2: this solves it for me:

1- flutter clean

2- delete all *.g.dart if exist

3- go on dev channel: flutter channel dev

4- upgrade: flutter upgrade --force

5- flutter pub get

6- try to build: flutter pub run build_runner build

7- back on stable or master channel: flutter channel stable (flutter channel master)

8- upgrade: flutter upgrade --force


0
votes

If anyone is stuck with the same issue try upgrading flutter from v1.20.1 to v1.20.2

0
votes

Make sure that your project name doesn't contain '%20' characters. This causes any build methods, like flutter packages pub run build_runner build --delete-conflicting-outputs and flutter pub run build_runner clean to fail.