ch271828n
ch271828n

Reputation: 17587

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!

Upvotes: 3

Views: 669

Answers (1)

CoderUni
CoderUni

Reputation: 6134

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"

Upvotes: 3

Related Questions