The current Dart SDK version is 2.15.1.
Because flutter_projects requires SDK version >=2.17.6 <3.0.0, version solving failed.
but the dart version is 2.19.0
I'm guessing that you can just update pubspec.yaml file. Write this instead.
environment:
sdk: ">=2.15.1 <3.0.0"
Or upgrade your flutter version by running:
flutter upgrade
Related
In my project I am using flutter package new_version_plus but when I use pub get it gives an error as follows:
Because package_name requires SDK version >=2.17.6 <3.0.0, version solving failed.
pub get failed (1; Because package_name requires SDK version >=2.17.6 <3.0.0, version solving failed.)
exit code 1
I made the changes as per required SDK version but still I got the same error.
You need to upgrade flutter using flutter upgrade command and then flutter will use latest version of Dart SDK.
Update 'SDK version >=2.17.6 <3.0.0' like this in pubspec.yaml file.
pls check new version package official doc example : https://github.com/CodesFirst/new_version_plus/blob/master/example/pubspec.yaml
You should not update the dart version of this project, open pubspec.yaml file and update
environment: sdk: ">=2.12.0 <3.0.0" or Whatever your sdk version
to
environment: sdk: ">=2.16.0 <3.0.0"
Can anyone tell me why am I getting this error?
The current Dart SDK version is 2.12.0.
Because app requires SDK version >=2.15.1 <3.0.0, version solving failed.
pub get failed (1; Because app requires SDK version >=2.15.1 <3.0.0, version solving failed.)
here is my flutter --version
Flutter 2.10.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision db747aa133 (2 days ago) • 2022-02-09 13:57:35 -0600
Engine • revision ab46186b24
Tools • Dart 2.16.1 • DevTools 2.9.2
You should not update the dart version of this project, please open pubspec.yaml file and update
environment:
sdk: ">=2.12.0 <3.0.0"
to
environment:
sdk: ">=2.16.0 <3.0.0"
Run flutter upgrade, after run flutter pub get
I think you should update dart version, can upgrade dart version this link
like #Yasin Ege says, dart need to upgrade in order to use:
flutter channel <channel to update master or beta>
flutter upgrade
I have had the same issue.
Go to pubspec.yaml and change then make it :
environment:
sdk: '>=2.15.1 <3.0.0'
No need to upgrade flutter if you are already in the latest version. Just do this and I hope this will work.
you can resolve this error by changing :
flutter_lints: ^2.0.0 To flutter_lints: ^1.0.0 in pubspace.yaml.
flutter channel <master or beta>
flutter upgrade
But if you check dart --version is the version that matches the version the project requires and still get the error "version solving failed." like this.
flutter clean
flutter channel <master or beta>
flutter upgrade --force
When prompting your command just use flutter pub add ... instead of dart
Go pubspec.yaml and edit minimun to your dart version
From
environment:
sdk: ">=2.15.1 <3.0.0"
To
environment:
sdk: ">=2.12.0 <3.0.0"
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"
$fvm flutter run
Running "flutter pub get" in flutterweb...
The current Dart SDK version is 2.13.4.
Because flutterweb requires SDK version >=2.14.0 <3.0.0, version solving failed.
I have this error.
Hoever --version is 2.14.2
$ dart --version
Dart SDK version: 2.14.2 (stable) (Wed Sep 15 12:32:06 2021 +0200) on "macos_x64"
in pubspec.yaml
environment:
sdk: ">=2.14.0 <3.0.0"
Where should I check??
I did it this way: Open the cmd as Administrator, and run:
flutter upgrade
This works for me.
Which Flutter version are you using? 2.5?
Because different flutter versions require different dart versions. You should try flutter upgrade and if that doesn't fix it, try flutter channel stable.
I'm getting below message in output while running flutter pub get even though I've downgraded google map package to google_maps_flutter: ^0.5.33 which is <1.0.0.
[proj_name] flutter pub get
Running "flutter pub get" in proj_name...
The current Flutter SDK version is 1.22.0-9.0.pre.
Because proj_name depends on google_maps_flutter >=1.0.0 which requires Flutter SDK version >=1.22.0 <2.0.0, version solving failed.
pub get failed (1; Because proj_name depends on google_maps_flutter >=1.0.0 which requires Flutter SDK version >=1.22.0 <2.0.0, version solving failed.)
exit code 1
Code snippet of pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
google_maps_flutter: ^0.5.33
Result of flutter --version
Flutter 1.22.0-9.0.pre • channel unknown • unknown source
Framework • revision 7a43175198 (3 months ago) • 2020-08-28 23:18:04 -0400
Engine • revision 07e2520d5d
Tools • Dart 2.10.0 (build 2.10.0-73.0.dev)
Follow up the steps:
flutter channel stable
flutter upgrade
Then Try again if you get the same error then
just change in your pubspec.yaml file: from this
google_maps_flutter: ^0.5.33
to this
google_maps_flutter:
It will automatically work as it will find out the version which is compatible itself.
Try to remove the ^ in pubspec.yaml declaration
google_maps_flutter: ^0.5.33 to google_maps_flutter: '0.5.33'
If I'm not mistaken, the ^ means take this version or higher.
Update flutter version to 2.0.2 stable then clean and run app, this will solve issue