Flutter dependency error – Version Solving failed

Issue

I’m trying out integration testing for my app. When I am trying to add the integration_test dependency to my pubspec.yaml I’m getting this error:

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.)

What should I do next to resolve this error?

Solution

This error happens because the integration_test package in your pubspec.yaml depends on flutter_driver, which required package crypto v3.0.1, while the uuid package you are using is at version 2.2.2, which required crypto v2.0.0, hence the conflicting version on crypto.

You should fix the versioning of the following packages in your pubspec.yaml. It’s best to update them to the latest to avoid the above conflict:

  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 as well)

Answered By – Bach

Answer Checked By – David Marino (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.