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!

1

There are 1 best solutions below

0
On BEST ANSWER

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"