5

I am getting the following error after running flutter upgrade:

Because every version of flutter_test from sdk depends on path 1.5.1 and flutter_advanced_networkimage >=0.2.9+1 depends on path ^1.6.0, flutter_test from sdk is incompatible with flutter_advanced_networkimage >=0.2.9+1. So, because testapp depends on both flutter_advanced_networkimage ^0.2.10 and flutter_test any from sdk, version solving failed. pub upgrade failed (1)

My pubspec.yaml:

name: testapp
description: A new Flutter application.

dependencies:
  flutter:
    sdk: flutter
  device_info: "^0.2.0"
  shared_preferences: "^0.4.1"
  flutter_parallax: "^0.1.1"
  cached_network_image: "^0.4.1"
  connectivity: "^0.3.1"
  chewie: "^0.6.0"
  flutter_statusbarcolor: "^0.0.3"
  fluro: "^1.3.1"
  carousel_slider: "^0.0.4"
  flutter_advanced_networkimage: "^0.2.10"
  flutter_sticky_header: "^0.3.0"

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

I'm trying to get it working for hours, please help

Conscript
  • 607
  • 6
  • 21
  • 1
    I assume you are using the `beta` channel. I think this doesn't happen in `dev` channel. Run in command line shell `flutter channel dev` `flutter doctor` and try again. – Günter Zöchbauer Jul 17 '18 at 07:35
  • 1
    @GünterZöchbauer okay, I am testing your solution and it is trying to download many things, I will notify you as soon as I see any results. – Conscript Jul 17 '18 at 07:47
  • 1
    @GünterZöchbauer that was indeed the issue, thank you for your quick response. Please submit your answer so I can mark it. – Conscript Jul 17 '18 at 07:51

2 Answers2

3

I assume you are using the beta channel.
I think this doesn't happen in dev channel.

To switch to the dev channel run in a command line shell

flutter channel dev 
flutter doctor 

and try again.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
1

I've had similar problems. My problem like this:

Because every version of flutter_test from sdk depends on http 0.12.0 and flutter_cache_manager 0.1.2 depends on http ^0.11.3+14, flutter_test from sdk is incompatible with flutter_cache_manager 0.1.2. And because no versions of flutter_cache_manager match >0.1.2 <0.2.0, flutter_test from sdk is incompatible with flutter_cache_manager ^0.1.2.

Here's how I solved it:

dependencies:
    ...
dependency_overrides:
  http: ^0.12.0

so, I thank you can try it:

dependencies:
    ...
dependency_overrides:
  path: ^1.6.0
dujianchi
  • 964
  • 8
  • 9