Flutter :How to solve flutter_svg pub get failed error?

Viewed 14795

when I install flutter_svg: ^0.18.0 in pubspec.yaml I got error , how to solve this error ?

Pkg url : Click here to view flutter_svg Pkg

Error :

The current Flutter SDK version is 1.17.5.

Because detox depends on flutter_svg >=0.18.0 which requires Flutter SDK version >=1.18.0-6.0.pre <2.0.0, version solving failed.
pub get failed (1; Because detox depends on flutter_svg >=0.18.0 which requires Flutter SDK version >=1.18.0-6.0.pre <2.0.0, version solving failed.)
Process finished with exit code 1

flutter version :

Flutter is already up to date on channel stable
Flutter 1.17.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8af6b2f038 (12 days ago) • 2020-06-30 12:53:55 -0700
Engine • revision ee76268252
Tools • Dart 2.8.4
3 Answers

The version of flutter_svg (0.18.0) can only work with versions of flutter from 1.18.0-6.0.pre above. So you'll have to use a lower version of the flutter_svg package.

Try flutter_svg version 0.17.4

replace

flutter_svg: ^0.18.0

with

flutter_svg: ^0.17.4

in your pubspec.yaml

  • First, open your pubspec.yaml file.

  • Click Pub outdated menu at the top right corner. If are using android studio IDE.

After a couple of seconds later you will see a list of the package names with version numbers as tabular view.

  • Update flutter_svg: x.x.x with the latest version number under dependencies.

  • Also, you have to update flutter_launcher_icons: x.x.x version under dev_dependencies as well.

  • Click, Pub get the menu for update.

After successful getting all packages. Run your App and enjoy happy coding. Thanks

Upgrade flutter_svg: ^0.18.0 then build success (Add manually and run pub get)

Related