Flutter 诊断颤振版本解决问题

Flutter 诊断颤振版本解决问题,flutter,dart,dependency-management,Flutter,Dart,Dependency Management,在跟踪到我的颤振应用程序时,我在运行程序包get时遇到以下错误: Because test <1.3.0 requires SDK version >=1.8.0 <2.0.0-∞ and test >=1.3.0 <1.6.1 depends on stream_channel ^1.6.0, test <1.6.1 requires stream_channel ^1.6.0. And because test >=1.6.0 <1.6.5 d

在跟踪到我的颤振应用程序时,我在运行
程序包get
时遇到以下错误:

Because test <1.3.0 requires SDK version >=1.8.0 <2.0.0-∞ and test >=1.3.0 <1.6.1 depends on stream_channel ^1.6.0, test <1.6.1 requires stream_channel ^1.6.0.
And because test >=1.6.0 <1.6.5 depends on analyzer >=0.26.4 <0.37.0 and test >=1.6.4 <1.6.8 depends on test_api 0.2.6, test <1.6.8 requires stream_channel ^1.6.0 or analyzer >=0.26.4 <0.37.0 or test_api 0.2.6.
And because test >=1.6.8 <1.6.11 depends on test_api 0.2.7 and test >=1.6.11 depends on test_api 0.2.8, every version of test requires test_api 0.2.6 or 0.2.7 or 0.2.8 or stream_channel ^1.6.0 or analyzer >=0.26.4 <0.37.0.
And because every version of flutter_test from sdk depends on both stream_channel 2.0.0 and test_api 0.2.5, if flutter_test any from sdk and test any then analyzer >=0.26.4 <0.37.0.
And because json_serializable 3.2.3 depends on analyzer >=0.37.1 <0.39.0 and my_app depends on test any, flutter_test from sdk is incompatible with json_serializable 3.2.3.
So, because my_app depends on both json_serializable 3.2.3 and flutter_test any from sdk, version solving failed.

希望有人能给我一个指向正确方向的指针。

您是否尝试从pubsec.yaml中删除
test
依赖项? 看起来颤振SDK上已经存在
flatter\u测试


environment:
  sdk: ">=2.2.2 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^0.1.2
  flutter_svg: 0.14.2
  email_validator: 1.0.0
  dio: 3.0.2
  dio_cookie_manager: 1.0.0
  cookie_jar: 1.0.1
  provider: 3.1.0
  path_provider: 1.3.0
  json_annotation: 3.0.0
  timeago: 2.0.19
  flutter_launcher_icons: 0.7.3

dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: 1.7.1
  json_serializable: 3.2.3
  mockito: 4.1.1
  flutter_driver:
    sdk: flutter
  test: any