Can't pub-get from pubspec.yaml file in Flutter app - flutter

Every time I want to install a package it gives this error, how do I fix it? The error output is below:
The current Dart SDK version is 2.12.3.
The current Flutter SDK version is 0.0.0-unknown.
Because image_picker >=0.3.0 requires Flutter SDK version >=0.1.4 and image_picker <0.3.0 requires SDK version >=1.8.0 <2.0.0, image_picker is forbidden.
So, because firebase depends on image_picker any, version solving failed.
Running "flutter pub get" in firebase...
pub get failed (1; So, because firebase depends on image_picker any, version solving failed.)

You check your flutter version and check that dependency version and change the dependency version otherwise remove the version.

You have to either:
Downgrade the version of image_picker to match the flutter SDK version you currently use, or
Upgrade your flutter SDK version to a version above or equal to 1.8.0. (preferred solution).

Related

i can not add any dependency on flutter like google font, and lottie

Because day13 depends on google_fonts >=2.3.1 which requires Flutter SDK version >=2.10.0-0, version solving failed.
pub get failed (1; Because day13 depends on google_fonts >=2.3.1 which requires Flutter SDK version >=2.10.0-0, version solving failed.)
exit code 1
Downgrade the version of you google_fonts package in your pubspec.yaml.
Try to change it to a 2.3.0 or below. Check versions here that will work:
https://pub.dev/packages/google_fonts/versions

Dart version changes

Im getting the following error while getting the google_maps dependency on a flutter app
Because app requires SDK version >=2.14.0 <3.0.0, version solving failed.
pub get failed (1; Because app requires SDK version >=2.14.0 <3.0.0, version solving failed.)
Im currently in version The current Dart SDK version is 2.14.0-188.5.beta.
does this mean my dart version is not updated?
I solved the problem by downgrading google_maps_flutter but is this the correct way of doing things?
Change sdk version in pubspec.yaml to
environment:
sdk: ">=2.14.0 <3.0.0"

I am getting an error in flutter setup in android studio in windows, i already updated and having latest version of flutter and android studio

After completing all steps like SDK download, path setup in windows getting this error in flutter setup.
This error is occuring before creating flutter project.
The current Dart SDK version is 2.9.2. Because flutter_tools depends on test >=1.16.0-nullsafety which requires SDK version >=2.10.0-0 2.11.0, version solving failed. pub get failed (1; Because flutter_tools depends on test >=1.16.0-nullsafety which requires SDK version >=2.10.0-0 2.11.0, version solving failed.)
Please show your pubspec file. If you have tried all possible solutions and can't figure out the issue, I would say to try and reinstall it.

Get packages not working because of version failing

Not much to add but why would pub get fail with this error..
The current Dart SDK version is 2.9.0-14.1.beta.
Because pos_app requires SDK version >=2.9.0 <3.0.0, version solving failed.
pub get failed (1; Because pos_app requires SDK version >=2.9.0 <3.0.0, version solving failed.)
exit code 1
i had the same problem, fixed switching to flutter dev channel (in my case) and upgrading version to match the requirements.
run flutter doctor -v
you'll see that your flutter sdk version runs a dart sdk that not match the project requirements, even if you installed the latest version of dart sdk on your ide. (this made me confused)

Flutter issue - Flutter_driver from sdk depends on file 5.0.6 and flutter_gallery depends on file 5.0.7

I got this issue using flutter packages get:
Because every version of flutter_driver from sdk depends on file 5.0.6 and flutter_gallery depends on file 5.0.7, flutter_driver from sdk is forbidden.
So, because flutter_gallery depends on flutter_driver any from sdk, version solving failed.
pub upgrade failed (1)
I don't know what I am supposed to do here, I was trying to compile this flutter example: https://github.com/flutter/flutter/tree/master/examples/flutter_gallery
This may be because flutter dependencies are locked to fixed versions.
You can check this in the pubspec.yaml for flutter_driver which is in
\flutter\packages\flutter_driver
and compare it to the latest version at GitHub
If so, flutter upgrade won't necessarily update the dependencies versions. Doing a forced update of the packages may resolve your problem.
flutter update-packages --force-upgrade