Open jerryboy1031 opened 1 year ago
There's a version conflict between two packages. Both mockito
and flutter_test
depend on test_api
, but they require different versions of test_api
.
This error arises when different packages have conflicting requirements for the same dependency.
Take a look at: How to solve multi dependency version conflicts simply?
The Simplest way:
just remove the version number of both that dependencies and type 'any' without quotes in front of them.
dev_dependencies:
flutter_test:
sdk: flutter
test: any
mockito: any
flutter_launcher_icons: ^0.7.3
snippet of pubspec.yaml file
Action: Run
flutter pub get
Output
Because mockito >=4.1.2 <=5.0.0-nullsafety.7 depends on test_api ^0.2.19-nullsafety and mockito >=4.1.1+1 <4.1.2 depends on test_api >=0.2.1 <0.4.0, mockito >=4.1.1+1 <=5.0.0-nullsafety.7 requires test_api >=0.2.1 <0.4.0. And because every version of flutter_test from sdk depends on test_api 0.4.16, flutter_test from sdk is incompatible with mockito >=4.1.1+1 <=5.0.0-nullsafety.7. So, because fluttube depends on both flutter_test from sdk and mockito ^4.1.1+1, version solving failed. pub get failed
exit code: 1