Flutter automation testing dependency issue - flutter

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.

Related

i am getting below problem on installing packages

any one can help me?
mine project is about news feed i want that output
[Flutter-News-App] flutter pub upgrade
Running "flutter pub get" in Flutter-News-App... Resolving dependencies...
Connection closed before full header was received
pub finished with exit code 69
exit code 69
Because no versions of mockito match >4.1.1 <4.1.1+1 and mockito >=4.1.1+1 <4.1.2 depends on test_api >=0.2.1 <0.4.0, mockito >4.1.1 <4.1.2 requires test_api >=0.2.1 <0.4.0.
And because mockito >=4.1.2 <=5.0.0-nullsafety.7 depends on test_api ^0.2.19-nullsafety, mockito >4.1.1 <=5.0.0-nullsafety.7 requires test_api >=0.2.1 <0.4.0.
And because mockito 4.1.1 depends on test_api ^0.2.1 and every version of flutter_test from sdk depends on test_api 0.4.12, mockito >=4.1.1 <=5.0.0-nullsafety.7 is incompatible with flutter_test from sdk.
So, because flutter_news_app depends on both flutter_test from sdk and mockito ^4.1.1, version solving failed.
pub get failed (1; So, because flutter_news_app depends on both flutter_test from sdk and mockito ^4.1.1, version solving failed.)
exit code 1
I don't know if you are upgrading or just installing, otherwise I think running
flutter pub get will solve your issue

integration_test Depends on Old Version of test_api (0.4.3) - How Can I Upgrade?

I'm trying to keep all my dependencies up to date, but integration_test and flutter_test seem to depend on test_api 0.4.3, and won't accept versions higher than this. I've had this problem for several months. I've watched several Flutter versions roll by. Each time, I think it will be fixed, and the problem remains. I currently have installed
Flutter 2.8.1 • channel stable
The current version of test is 1.20.1 but if I try to use the latest package, I get this error when I do a flutter pub get
Because test >=1.20.0 depends on test_api 0.4.9 and every version of integration_test from sdk depends on test_api 0.4.3, test >=1.20.0 is incompatible with
integration_test from sdk.
So, because assets_app depends on both integration_test from sdk and test ^1.20.1, version solving failed.
I checked out the package on GitHub for integration_test and as you can see, it points to 0.4.9 of test_api. So, the only thing I can think of is that the current Flutter SDK points to an older version of integration_test.
It looks as though test is generally outdated because if I try to upgrade analyzer, I get this:
Because every version of flutter_test from sdk depends on test_api 0.4.3 and test >=1.20.0 depends on test_api 0.4.9, flutter_test from sdk is incompatible with test >=1.20.0.
And because test >=1.17.10 <1.20.0 depends on analyzer >=1.0.0 <3.0.0 and test >=1.16.6 <1.17.10 depends on analyzer ^1.0.0, if flutter_test from sdk and test >=1.16.6 then analyzer >=1.0.0 <3.0.0.
And because test >=1.16.1 <1.16.6 depends on analyzer >=0.39.5 <2.0.0 and test >=1.16.0-nullsafety.10 <1.16.1 depends on analyzer >=0.36.0 <0.42.0, if flutter_test from sdk and test >=1.16.0-nullsafety.10 then analyzer >=0.36.0 <3.0.0.
And because test >=1.16.0-nullsafety <1.16.0-nullsafety.8 requires SDK version >=2.10.0-0 <2.12.0 and test <1.3.0 requires SDK version >=1.8.0 <2.0.0-∞, if flutter_test from sdk and test <1.3.0-∞ or >=1.16.0-nullsafety <1.16.0-nullsafety.8 or >=1.16.0-nullsafety.10 then analyzer >=0.36.0 <3.0.0.
And because test >=1.3.0 <1.16.0-nullsafety depends on yaml ^2.0.0 and test >=1.16.0-nullsafety.8 <1.16.0-nullsafety.12 depends on yaml ^2.0.0, if flutter_test from sdk and test any then analyzer >=0.36.0 <3.0.0 or yaml ^2.0.0.
And because assets_app depends on analyzer ^3.2.0 which depends on yaml ^3.0.0, flutter_test from sdk is incompatible with test.
So, because assets_app depends on both flutter_test from sdk and test any, version solving failed.
How can we upgrade integration_test so that we can also use test_api 0.4.9, and test 1.20.1 ?
Flutter pins it's dependencies. That's it. You have two options.
Wait for the next flutter release that has a version pin that you want
add a dependency override to get the latest version
In my case the problem was with the integration_test package
Accessing the flutter eintegration test package via cli , you can update the dependencies.
pubspec.yaml in integration_test contains this in every package you can update.
archive: 3.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
So I ran "flutter update-packages --force-upgrade"
He updated the conflict and I had no more problems.

Because analyzer >=2.0.0 depends on meta ^1.7.0 ... (because myP depends on both flutter_test any from sdk and analyzer 2.0.0, version solving failed)

Is there any other way to resolve this issue other than going on the dev channel (or than using analyzer <2.0.0)? I once made a poor, time consuming experience with the dev channel which is why I would prefer sticking with stable. And I need 2.0.0 for a bug fix of another package.
Because analyzer >=2.0.0 depends on meta ^1.7.0 and every version of
flutter_test from sdk depends on meta 1.3.0, analyzer >=2.0.0 is
incompatible with flutter_test from sdk. So, because denkschule
depends on both flutter_test any from sdk and analyzer 2.0.0, version
solving failed. pub get failed (1; So, because myP depends on both
flutter_test any from sdk and analyzer 2.0.0, version solving failed.)
In this case, since version 1.7.0 of package:meta is probably backward compatible with version 1.3.0, I think that it would be safe to add a dependency override to your pubspec.yaml file to force using the newer version:
dependency_overrides:
meta: ^1.7.0
(package:meta in particular should be safe since that package just provides annotations for static analysis and shouldn't affect runtime behavior.)

Why can't I use the async library from pub.dev?

Um.. yeah... so I wanted to use a Timer in a flutter app, and realized I needed to import the async library in order to do so.
So, per the installation instructions on pub.dev, I added the dependency to pubspec.yaml:
async: ^2.5.0
But when I run pub-get, the following text shows up in the messages tab:
Because every version of flutter_test from sdk depends on async
2.5.0-nullsafety.1 and flutter_app depends on async ^2.5.0, flutter_test from sdk is forbidden. So, because flutter_app depends on
flutter_test any from sdk, version solving failed. pub get failed (1;
So, because flutter_app depends on flutter_test any from sdk, version
solving failed.)
I'm trying to decipher this. Can you decipher this complex boolean algebraic word problem?

Error on : Because every version of integration_test from sdk depends on vm_service 6.0.1-nullsafety.1 and dwds ^7.1.0 depends on vm_service 5.5.0,

I'm new to flutter and I've been having dependency issues on flutter Keep having this same error
Because every version of integration_test from sdk depends on vm_service 6.0.1-nullsafety.1 and dwds ^7.1.0 depends on vm_service 5.5.0, integration_test from sdk is incompatible with dwds ^7.1.0.
So, because brandapp depends on both dwds ^7.1.0 and integration_test any from sdk, version solving failed.
pub get failed (1; So, because brandapp depends on both dwds ^7.1.0 and integration_test any from sdk, version solving failed.)```