KoKa
KoKa

Reputation: 817

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?

Upvotes: 6

Views: 18528

Answers (2)

Dinesh Balasubramanian
Dinesh Balasubramanian

Reputation: 21718

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

Upvotes: 1

LarssonK
LarssonK

Reputation: 3033

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.

Upvotes: 6

Related Questions