flutter packages get fails, version solving failed
Solution 1
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.
Solution 2
As per the error message
- Dart SDK version is 2.1.0-dev.4.0.flutter-050561fd82 and
- 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
KoKa
Updated on December 06, 2022Comments
-
KoKa 5 minutes
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?
-
KoKa about 4 yearsThanks a lot for the reply! I cloned the repository, upgraded flatter_map and location packages and modified packages functions used to the project.