4

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)
Faizan Kamal
  • 1,732
  • 3
  • 27
  • 56

3 Answers3

5

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.

Jagadish
  • 1,005
  • 11
  • 30
1

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.

Migalv
  • 652
  • 6
  • 19
0

Update flutter version to 2.0.2 stable then clean and run app, this will solve issue

Bibin Baby
  • 163
  • 1
  • 3