skip to Main Content

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 1

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
depends on both cached_network_image ^3.2.3 and http ^1.0.0, version
solving failed.

2

Answers


  1. There is a dependency conflict in your project. Temporarily, you can downgrade your http package to a version that is compatible with both cached_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.

    Login or Signup to reply.
  2. There is dependency conflict in your project. And I think you can resolve via using dependency_overrides: in you pubspec.yaml.

    dependency_overrides: is for manual override. you are
    I think manually overriding the http: and cached_network_image: packages to a specific version would solve this problem.

    Like this.

    dependency_overrides:
      http: 0.1x.x
      cached_network_image: 3.x.x
    

    For the version of each package, Please choice the appropriate version by referring to your Flutter SDK and Dart SDK versions.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search