why does flutter show me this error and how can i solve it?

Viewed 3293

Good morning, I have a problem with the flutter app am using vscode, and after resolving the configuration's problems I have this problem and I couldn't solve it can you please help me with this?

when I run "flutter pub get" it shows me this message:

Because every version of flutter_test from SDK depends on meta 1.3.0 and active_ecommerce_flutter depends on meta ^1.4.0, flutter_test from SDK is forbidden. So, because active_ecommerce_flutter depends on flutter_test any from SDK, version solving failed. Running "flutter pub get" in ACT... pub get failed (1; So, because active_ecommerce_flutter depends on flutter_test any from SDK, version solving failed.)

thank you for your collaboration.

3 Answers

This problem is because your flutter version is using meta 1.3.0and your active_ecommerce_flutter is using meta 1.4.0 causing a conflict.

Solution 1:

Upgrade your flutter version by typing flutter upgrade in the terminal.

However, at the point of time of writing this answer, the latest stable version of flutter is still using meta 1.3.0. Thus, you will need to upgrade from a different channel than "stable", like (beta, dev, or master).

example:

 flutter channel dev
 flutter upgrade

Solution 2:

Try downgrading your active_ecommerce_flutter step by step till reaching a compatible version.

Solution 3: (Recommended)

Just add this line in your pubspec.yaml file:

dependency_overrides:
  meta: ^1.3.0

This will force using meta: ^1.3.0

I think This is an SDK issue which you are using,

Upgrade your SDK from the following command:

flutter upgrade --force

OR

flutter upgrade

after upgrading SDK run flutter pub get

I hope this will fix your problem, Happy Fluttering.

I had this problem yesterday another package. I solved downgrade package version of troubled package. So you can try downgrade active_ecommerce_flutter

Related