I am trying to install cached network image package in my flutter project but i keep getting this error message
Resolving dependencies… Because cached_network_image >=3.2.0 depends
on flutter_cache_manager ^3.3.0 which depends on http ^0.13.0,
cached_network_image >=3.2.0 requires http ^0.13.0. So, because
project depends on both cached_network_image ^3.2.3 and http ^1.0.0,
version solving failed. exit code 1Resolving dependencies… Because cached_network_image >=3.2.0 depends
on flutter_cache_manager ^3.3.0 which depends on http ^0.13.0,
cached_network_image >=3.2.0 requires http ^0.13.0. So, because
depends on both cached_network_image ^3.2.3 and http ^1.0.0, version
solving failed.
2
Answers
There is a dependency conflict in your project. Temporarily, you can downgrade your
http
package to a version that is compatible with bothcached_network_image
and your project (e.g.,http: ^0.13.6
).Also there is a pull request in the
cached_network_image
repository that solves this problem, but it hasn’t been merged yet.There is dependency conflict in your project. And I think you can resolve via using
dependency_overrides:
in youpubspec.yaml
.dependency_overrides:
is for manual override. you areI think manually overriding the
http:
andcached_network_image:
packages to a specific version would solve this problem.Like this.
For the version of each package, Please choice the appropriate version by referring to your Flutter SDK and Dart SDK versions.