lundi 5 octobre 2020

Flutter automation testing dependency issue

I am trying to start with UI automation tests in my flutter app. I am following this particular VIDEO. I was able to establish the part where you write the following snippet into pubspec.yaml

    dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_driver:
    sdk: flutter

I need both flutter_test and flutter driver.

But when I add

test: any

I get this following error after hitting Get Dependencies

The current Dart SDK version is 2.8.4.

Because test <1.3.0 requires SDK version >=1.8.0 <2.0.0-∞ and test

=1.16.0-nullsafety requires SDK version >=2.10.0-0 <2.11.0, test <1.3.0-∞ or >=1.16.0-nullsafety is forbidden.

And because test >=1.3.0 <1.12.0 depends on boolean_selector ^1.0.0, test <1.12.0-∞ or >=1.16.0-nullsafety requires boolean_selector ^1.0.0.

And because test >=1.9.3 <1.15.4 depends on analyzer >=0.36.0 <0.40.0 and every version of flutter_test from sdk depends on boolean_selector 2.0.0, if flutter_test any from sdk and test <1.15.4-∞ or >=1.16.0-nullsafety then analyzer >=0.36.0 <0.40.0.

And because test >=1.15.4 <1.16.0-nullsafety depends on analyzer

=0.36.0 <0.41.0 and json_serializable 0.5.8+1 depends on analyzer ^0.32.0, one of flutter_test any from sdk or test any or json_serializable 0.5.8+1 must be false.

Because json_serializable >=0.1.0+1 <=0.5.8 requires SDK version

=1.22.1 <2.0.0-∞ and no versions of json_serializable match >0.5.8+1 <0.6.0, json_serializable >=0.1.0+1 <0.5.8+1 or >0.5.8+1 <0.6.0 is forbidden.

Thus, one of flutter_test any from sdk or test any or json_serializable >=0.1.0+1 <0.6.0 must be false.

And because MyApp depends on json_serializable ^0.5.0, flutter_test from sdk is incompatible with test.

So, because MyApp depends on both flutter_test any from sdk and test any, version solving failed. pub get failed (1; So, because MyApp depends on both flutter_test any from sdk and test any, version solving failed.)

I even tried to put there some specific version like 1.5.4 into the test parameter I get the same error.

PS:

My Flutter version is 1.17.4 My Dart Version 2.8.4

Is there a way how get rid of the error mentioned above? As I said, when I do not use "test" parameter everything works. I guess I will need this parameter later on.

Aucun commentaire:

Enregistrer un commentaire