Flutter 错误状态:意外诊断:颤振升级到1.20.1后
问题是什么Flutter 错误状态:意外诊断:颤振升级到1.20.1后,flutter,dart,chopper,Flutter,Dart,Chopper,问题是什么 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 scri
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
在花了3个多小时之后,我终于解决了这个问题 对于升级到Flatter版本1.20.1或更高版本的用户,请确保在
pubspec.yaml
中添加此行
dependency_overrides:
analyzer: '0.39.14'
我也有同样的问题:
请在您的pubspec文件中尝试此选项
dependency_overrides:
analyzer: '0.39.17'
build_resolvers: '1.3.10'
试试看:
1-颤振清洁
2-进入开发频道:颤振频道开发
3-升级:flatter升级-强制
4-flatter pub get
5-尝试建立
6-返回稳定通道或主通道:颤振通道稳定
(颤振通道主通道
)
7-升级:
flatter升级--force
我也有同样的问题,如果接受的答案不能解决您的问题,您可以尝试以下步骤:
flatter clean
flatter pub get
flatter软件包升级
analyzer:^0.39.17
直接依赖开发为我工作