build_runner не работает после обновления flutter до 1.20.1

В чем проблема?

xxx@xxx-Inspiron-14-3467:~/xxx$ flutter pub run build_runner build[INFO] Generating build script...
[INFO] Generating build script completed, took 406ms

[WARNING] Deleted previous snapshot due to missing asset graph.
[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 14.6s

[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 773ms

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms

[INFO] Running build...
[INFO] Generating SDK summary...
[SEVERE] chopper_generator:chopper_generator on test/widget_test.dart:

Bad state: Unexpected diagnostics:
/home/xxx/Desktop/flutter_linux_1.20.1-stable/flutter/bin/cache/dart-sdk/lib/core/uri.dart:3259:39 - Expected an identifier.
[SEVERE] chopper_generator:chopper_generator on test/widget_test.dart:

Bad state: Unexpected diagnostics:
/home/xxx/Desktop/flutter_linux_1.20.1-stable/flutter/bin/cache/dart-sdk/lib/core/uri.dart:3259:39 - Expected an identifier.
[INFO] 1.6s elapsed, 1/17 actions completed.
[INFO] 2.7s elapsed, 1/17 actions completed.
[INFO] 3.8s elapsed, 1/17 actions completed.
[INFO] 4.9s elapsed, 1/17 actions completed.
[INFO] 6.0s elapsed, 1/17 actions completed.
[INFO] 7.1s elapsed, 1/17 actions completed.
[INFO] 8.2s elapsed, 1/17 actions completed.
[INFO] 9.3s elapsed, 1/17 actions completed.
[INFO] 10.4s elapsed, 1/17 actions completed.
[INFO] 11.5s elapsed, 1/17 actions completed.
[INFO] 12.6s elapsed, 1/17 actions completed.
[INFO] 13.7s elapsed, 1/17 actions completed.
[INFO] 14.8s elapsed, 1/17 actions completed.
[WARNING] No actions completed for 15.1s, waiting on:
  - chopper_generator:chopper_generator on lib/repository/model/radio_model.dart
  - chopper_generator:chopper_generator on lib/repository/model/xxx.dart
  - chopper_generator:chopper_generator on lib/repository/model/time.dart
  - chopper_generator:chopper_generator on lib/repository/model/assign_to.dart
  - chopper_generator:chopper_generator on lib/repository/model/defect_cases_count.dart
  .. and 11 more

4 ответа

Решение

Проведя более 3 часов, я наконец решил.

Для тех, кто обновился до версии flutter 1.20.1 или выше, убедитесь, что вы добавили эту строку в pubspec.yaml.

dependency_overrides:
  analyzer: '0.39.14'

У меня была такая же проблема:

Пожалуйста, попробуйте это в своем файле pubspec

dependency_overrides:
  analyzer: '0.39.17'    
  build_resolvers: '1.3.10'

Попытайся :

1- flutter clean

2- перейти на канал разработчика: flutter channel dev

3- апгрейд: flutter upgrade --force

4- flutter pub get

5- попробуйте построить

6- возврат на стабильный или главный канал: flutter channel stable (flutter channel master)

7- апгрейд: flutter upgrade --force

У меня была такая же проблема, и если принятый ответ не решил вашу проблему, вы можете попробовать процедуру, описанную в этой проблеме:

  • flutter clean
  • flutter pub get
  • flutter packages upgrade
Другие вопросы по тегам