Reputation: 10493
While following the instructions to add integration tests to my Flutter app, I get the following error running packages 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.
That presumably indicates some sort of version conflict through the dependency graph, but I'm at a bit of a loss to work out quite what exactly the issue is or what I could do about it. My pubspec.yaml
looks like:
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
Hoping someone can give me a pointer in the right direction.
Upvotes: 0
Views: 705
Reputation: 718
did you try to remove the test
dependency from the pubsec.yaml?
Looks like that the flutter_test
package is already present on the flutter SDK.
Upvotes: 1