Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter packages get fails, version solving failed

I have the following issue: I have a flutter project opened with Android Studio. Inside Android Studio's terminal I run flutter packages get

Command fails with the following error:

Running "flutter packages get" in flutterfoodorderingapp...      
The current Dart SDK version is 2.1.0-dev.4.0.flutter-050561fd82.

Because food_ordering_app depends on flutter_map <0.1.0 which requires 
SDK version >=1.8.0 <2.0.0, version solving failed.                                                                          
pub get failed (1)

Any ideas how to solve it?

like image 470
KoKa Avatar asked Sep 18 '18 10:09

KoKa


People also ask

How do I update the latest version of Flutter packages?

To upgrade to a new version of the package, for example to use new features in that package, run flutter pub upgrade (Upgrade dependencies in IntelliJ or Android Studio) to retrieve the highest available version of the package that is allowed by the version constraint specified in pubspec. yaml .


2 Answers

Running "flutter packages get" in flutterfoodorderingapp... The current Dart SDK version is 2.1.0-dev.4.0.flutter-050561fd82.

Because food_ordering_app depends on flutter_map <0.1.0 which requires SDK version >=1.8.0 <2.0.0, version solving failed.

The package can only be used with SDK version 2.0.0 and below, the developer needs update the package to support the latest version of the Dart SDK (at time of writing is 2.1.0-dev.4.0). There isn't much you can do about this other than downgrading your SDK to use this particular package which might have a negative knock on effect on other packages. Or you could copy the package into your application or clone the repository and modify it yourself if you have access to it.

like image 129
F-1 Avatar answered Sep 25 '22 16:09

F-1


As per the error message

  1. Dart SDK version is 2.1.0-dev.4.0.flutter-050561fd82 and
  2. flutter_map version is less than 0.1.0.

And flutter_map < 0.1.0 requires SDK version >=1.8.0 <2.0.0

So either you have to downgrade your SDK to >=1.8.0 <2.0.0 or upgrade your flutter_map to be ^0.1.0.

It is preferred to upgrade your flutter_map to the version which supports your Dart SDK version. As per changelog, you can use flutter_map: ^0.1.0

like image 30
Dinesh Balasubramanian Avatar answered Sep 25 '22 16:09

Dinesh Balasubramanian