0
votes

I am trying to run a flutter theme code in visual studio code and facing this issue after running command (flutter run)

Because every version of flutter_test from sdk depends on vector_math 2.1.0-nullsafety.5 and fstore depends on vector_math 2.0.8, flutter_test from sdk is forbidden. So, because fstore depends on flutter_test any from sdk, version solving failed. Running "flutter pub get" in ecomputex...
pub get failed (1; So, because fstore depends on flutter_test any from sdk, version solving failed.)

Please helpenter image description here

1
Try running without specifying the package versions and let pub to that for you, for example: vector_math:Andrej
What flutter version are you on?Scott Godfrey
@ScottGodfrey i on the latest one Flutter 1.26.0-17.2.pre (developer version)Shahzaib-freelance
Then you have a version conflict with fstore. Flutter depends on vector_math 2.1.0-nullsafety.5 fstore depends on vector_math 2.0.8.Scott Godfrey
You will have to switch to stable channel. run flutter channel stable, flutter upgrade.Scott Godfrey

1 Answers

0
votes

just add this line of code in your pubspec

dependency_overrides:
  vector_math: 2.1.0-nullsafety.5

this will override the dependency, and you can use whatever version you want. you might need to change it the version of the package.

my code example:

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.0
  file_picker: ^3.0.0
  hive: ^2.0.0
  hive_flutter: ^1.0.0

dependency_overrides:
  path_provider: 2.0.1