27
votes

I have this error:

Running "flutter packages upgrade" in bingo360...
The current Dart SDK version is 2.1.2-dev.0.0.flutter-0a7dcf17eb. Because bingo360 depends on flutter_launcher_icons >=0.7.1 which requires SDK version >=2.2.0 <3.0.0, version solving failed. pub upgrade failed (1)

My pubspec.yaml is:

environment:
sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

cupertino_icons: ^0.1.2
http: ^0.12.0+1
flutter_launcher_icons: "^0.7.2"

dev_dependencies:
  flutter_test:
  sdk: flutter

I try to change to sdk: ">2.2.0 <3.0.0" but not works.

Any suggest?

3
Make sure your flutter is up to date. Run flutter doctor -v. That prints the version of Dart included with that version of flutter. Make sure that the Dart version is at least 2.2. (The current version of Dart, with flutter 1.5.4 beta, is 2.3.0)Richard Heap
@RichardHeap dart version is 2.1.2 and flutter is 1.2.1. how to update it?Italo Rodrigo
@RichardHeap thanks, this is my first project using flutterItalo Rodrigo

3 Answers

45
votes

Go to 'Tools' -> Flutter -> 'Flutter Upgrade'

See if that works it out. If it's the SDK that needs upgrading you can't manually alter it

24
votes

do this on your terminal :

flutter upgrade --force
0
votes

Close any code editor that might be using the SDK(VScode or Android Studio example). Find powershell and run as Admin. Type in the command - choco upgrade dart-sdk. This fixed my problem. I was able to run pub get without any errors.

Check out the source. https://dart.dev/get-dart