Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 424
Lynda Avatar asked Jul 29 '21 08:07

Lynda


People also ask

How are errors handled in flutter?

By default, in debug mode this shows an error message in red, and in release mode this shows a gray background. When errors occur without a Flutter callback on the call stack, they are handled by the Zone where they occur.

How to use the flutter analyze command?

The flutter analyze command also has a sub command known as flutter analyze –watch which is used to continuously monitor the file changes and print error message on screen. All we have to do is run the above command on terminal screen and start editing or modifying the source code.

How to analyze Dart code in flutter?

The Analyze command would start analyzing the dart code from beginning and goto end of code. If there is any type of Syntax error or code implementation error like keyword mistake, initialization mistake and declaration mistake then Flutter analyze command will find all the errors and print them on the Command Prompt or Terminal screen.

What is a flutter TRY-CATCH statement?

You’re going to see try-catch statements throughout the Flutter framework. You see, the framework does its best to anticipate where possible errors could occur. In this case, when an error does occur trying to build a widget, that error is caught in the try-catch statement, and the static function, ErrorWidget.builder, is then called.


1 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

like image 132
Mena Avatar answered Oct 09 '22 04:10

Mena