sdk version solving failed error on executing code - flutter

I am beginner in flutter. Doing a course from Udemy but facing lots of problems.I am making shop app.
The current Flutter SDK version is 0.0.0-unknown.
I'm getting the below error when I run it in Android Studio
Because shop_app depends on provider >=4.0.0-dev which requires
Flutter SDK version >=1.12.1, version solving failed. pub get failed
(1; Because shop_app depends on provider >=4.0.0-dev which requires
Flutter SDK version >=1.12.1, version solving failed.)

Related

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

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).

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)

Unable to add google_sign_in to flutter project, package requires older version of Flutter SDK?

New to Flutter so sorry about the question. Tried to change the environment but project won't build.
The current Flutter SDK version is 1.9.1+hotfix.6.
Because solemaster depends on google_sign_in >=4.0.16 which requires Flutter SDK version
>=1.10.0 <2.0.0, version solving failed.
pub get failed (1)
environment:
sdk: ">=2.1.0 <3.0.0"
The flutter SDK version you're using is older than the required by the library. You're confusing the Flutter SDK with the Dart SDK. The Dark SDK is the environment on the code you provided.
google_sign_in is based on the Flutter beta channel, instead of the stable channel. (p.s. this channel is where you get your flutter updates from).
From there, you have two options:
Use an older version of google_sign_in. Version 4.0.15 or 4.0.14 should do the trick, since this change was published today as said on the changelog.
On the pubspec.yaml file, change the current declaration to google_sign_in: 4.0.15.
Change to the beta channel. Keep in mind that the Flutter versions here are being tested, so you may experience some issues. To change channel, run flutter channel beta, then flutter upgrade.
try
flutter pub cache repair
flutter clean