添加了 get it 依赖项。 IDE 给出版本解决错误

时间:2021-03-13 12:09:54

标签: flutter flutter-dependencies

因为来自 sdk 的每个版本的 integration_test 都依赖于集合 1.15.0-nullsafety.5 并且 get_it >=6.0.0 依赖于集合 ^1.15.0,所以来自 sdk 的 integration_test 与 get_it >=6.0.0 不兼容。 因此,由于 mcuapp 依赖于 sdk 中的 get_it ^6.0.0 和 integration_test any,因此版本求解失败。 pub get failed (1; 所以,因为 mcuapp 依赖于 sdk 的 get_it ^6.0.0 和 integration_test any,版本求解失败。) 进程以退出代码 1 结束

注意:我最近升级了 Dart 和 Flutter

2 个答案:

答案 0 :(得分:0)

您可以尝试删除 pubspec.yaml 中的版本并将其替换为 any。 然而,这可能会破坏代码,因为它将使用其他版本的包。在某些情况下,某些软件包与其他软件包根本不兼容

答案 1 :(得分:0)

从 pubspec.yaml 文件更新所有依赖项,因为您更新了一些依赖项并且依赖于旧版本的依赖项。只是

<块引用>

转到 [pub.dev][1] > 搜索您的依赖项 > 将更新的版本复制到 pubspec.yaml 文件 > 运行 flutter pub get > flutter pub upgrade [1]:https://pub.dev/