flutter pub run build_runner stuck

A flutter pub upgrade solved my issue.


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.


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


Tags:

Dart

Flutter