Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter integration_test package conflict with my code and cannot be resolved by tweaking package versions - so the whole app cannot run

I have an app (with null-safety), and want to use integration_test package to do some testing. The pubspec.yaml looks like:

dependencies:
  archive: ^3.1.2
  ...

dev_dependencies:
  build_resolvers: ^2.0.0
  build_runner: ^1.11.5
  flutter_test:
    sdk: flutter
  integration_test:
    sdk: flutter
  ...

Then it errors:

Because every version of flutter_driver from sdk depends on archive 2.0.13 and my_app depends on archive ^3.1.2, flutter_driver from sdk is forbidden.

I cannot use the non-null-safety version (2.x) of archive package, because if I do so, my app code will fail to run in null safety mode! I can accept that my tests run in non-null-safety mode, but I cannot tolerate my app code run in non-null-safety mode.

Thanks for any suggestions!

like image 462
ch271828n Avatar asked Dec 18 '25 10:12

ch271828n


1 Answers

You need to override the archive package version to tell flutter_driver to use the latest one:

dev_dependencies:
  build_resolvers: ^2.0.0
  build_runner: ^1.11.5
  flutter_test:
    sdk: flutter
  integration_test:
    sdk: flutter
dependency_overrides:
  archive: ">=3.1.2"
like image 60
Uni Avatar answered Dec 21 '25 03:12

Uni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!