Search code examples
fluttergithubflutter-dependenciesflutter-build

problem with running every flutter app from github( Because xml >=4.4.0 <4.4.1 depends on petitparser ^3.1.0 and xml )


i am new to flutter, i have already made some small projects on my system but when I clone projects from github i cant build and run these projects, and I always get errors similar to this:

Because xml >=4.4.0 <4.4.1 depends on petitparser ^3.1.0 and xml >=3.7.0 <4.4.0 depends on petitparser ^3.0.0, xml >=3.7.0 <4.4.1 requires petitparser ^3.0.0.
And because xml >=4.4.1 <5.0.0-nullsafety.1 depends on petitparser ^3.0.0, xml >=3.7.0 <5.0.0-nullsafety.1 requires petitparser ^3.0.0.
And because every version of intl_translation from git depends on petitparser ^4.0.0 and flutter_svg >=0.18.1 <0.20.0-nullsafety.0 depends on xml ^4.2.0, intl_translation from git is incompatible with flutter_svg >=0.18.1 <0.20.0-nullsafety.0.
So, because natrium_wallet_flutter depends on both flutter_svg ^0.19.3 and intl_translation from git, version solving failed.
pub get failed (1; So, because natrium_wallet_flutter depends on both flutter_svg ^0.19.3 and intl_translation from git, version solving failed.)

i have two main questions, first what are these errors and why I can't fix them by pub get, second question is how to solve this issue? thanks for your help


Solution

  • These errors come from a conflict between your dependencies. It lists all the problematic dependencies and what flutter has tried to resolve them without success.

    You need to update your pubspec.yml (add it to your question could help) in order to resolve the issues. This is a reason why you should be careful adding dependencies to your projects as it makes maintainability harder and in a case of a dependency being a critical component of your app, if its support is stopped it is on you to take the project on (or find another solution).

    If you can you could try updating all dependencies to their latest version and then resolve potential issues with those which were not updated by they contributors (if any). Be careful changing a major version of a dependency may lead to some refactoring required.

    I don't know about intl but some people made an answer towards installing intl_utils: ^1.6.3 in this answer maybe your problems are related.