Flutter 依赖错误 - Version Solving failed

Flutter dependency error - Version Solving failed

我正在尝试对我的应用程序进行集成测试。当我尝试将 integration_test 依赖项添加到我的 pubspec.yaml 时,出现此错误:

Because no versions of uuid match >2.2.2 <3.0.0 and uuid 2.2.2 depends on crypto ^2.0.0, uuid ^2.2.2 requires crypto ^2.0.0. And because every version of integration_test depends on flutter_driver any from sdk which depends on crypto 3.0.1, uuid ^2.2.2 is incompatible with integration_test. So, because flutter_firebase_login depends on both integration_test ^1.0.2+3 and uuid ^2.2.2, version solving failed. pub get failed (1; So, because flutter_firebase_login depends on both integration_test ^1.0.2+3 and uuid ^2.2.2, version solving failed.)

接下来我应该怎么做才能解决这个错误?

发生此错误是因为 pubspec.yaml 中的 integration_test 包依赖于 flutter_driver,它需要包 crypto v3.0.1,而 uuid 包是使用的是版本 2.2.2,需要 crypto v2.0.0,因此 crypto.

上的版本冲突

您应该在 pubspec.yaml 中修复以下软件包的版本控制。最好更新到最新的,避免上面的冲突:

  1. uuid: ^3.0.4 (this package depends on crypto v3.0.1)
  2. integration_test: ^1.0.2+3 (this package depends on crypto v3.0.1 也)