Home > Mobile >  Flutter dependency conflict (versions depend on another )
Flutter dependency conflict (versions depend on another )

Time:07-01

I want to add avtar in my App but not able to do this because of dependency conflict/ required version error. I also trying to override dependency but its still not working. also trying this commands.

  • Flutter clean
  • Flutter pub get

But still not working.

ERROR:-

  Because no versions of random_avatar match >0.0.7 <0.1.0 and random_avatar 0.0.7 depends on flutter_svg ^1.0.3, random_avatar ^0.0.7 requires flutter_svg ^1.0.3.
    And because flutter_html >=2.0.0-nullsafety.1 <3.0.0-alpha.1 depends on flutter_svg >=0.22.0 <1.0.0, random_avatar ^0.0.7 is incompatible with flutter_html >=2.0.0-nullsafety.1 <3.0.0-alpha.1.
    So, because seedwill_demo depends on both flutter_html ^2.2.1 and random_avatar ^0.0.7, version solving failed.
    pub get failed (1; So, because seedwill_demo depends on both flutter_html ^2.2.1 and random_avatar ^0.0.7, version solving failed.)

enter image description here

enter image description here

CodePudding user response:

I guess You working on Flutter 2, but Flutter 3 is released. On pub, some libraries are default compatible with Flutter 3. In this case, not always newest library is the best option. You must find which library is incompatible. Can You put pubspec.yaml to this post? We need TWO version of pubspec.yaml. Previous (which have no error with pub get) and new, with this new library. If You show them, I try find the best version of library for You.

CodePudding user response:

I had problems that look alike, and somehow managed to eliminate them by upgrading flutter parts (updating or reinstalling). Have you tried following commands?

flutter clean

flutter upgrade

flutter pub upgrade

  • Related