Reputation: 1
I repeadtely get this erro while iusing ht eold version of sdk dat, but I did not use the old flutter. The current Dart SDK version is 3.2.3.
Because food_delivery depends on cupertino_icons >=0.1.1 <1.0.1 which doesn't support null safety, version solving failed.
The lower bound of "sdk: '<2.0.0 or >=2.0.0-dev.28.0 <3.0.0'" must be 2.12.0 or higher to enable null safety.
name: food_delivery
description: A new Flutter project.
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
firebase_core:
firebase_auth:
firebase:
cloud_firestore:
google_sign_in : ^4.0.7
flutter_masked_text: ^0.8.0
firebase_storage:
font_awesome_flutter:
image_picker:
firebase_database:
geolocator:
google_maps_flutter:
cupertino_icons: ^0.1.2
#cupertino_icons: ^<latest-version>
dev_dependencies:
flutter_test:
sdk: flutter
bloc_pattern:
rxdart:
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/1.png
- assets/google.png
- assets/moto.png
- assets/map.png
- assets/foodtukk.png
- assets/foodtukk1.png
- family: Quicksand
fonts:
- asset: assets/fonts/Quicksand-Medium.ttf
style: normal
- asset: assets/fonts/Quicksand_Bold.otf
weight: 700
- family: Raleway
fonts:
- asset: assets/fonts/Raleway-Regular.ttf
style: normal
- asset: assets/fonts/Raleway-Medium.ttf
Upvotes: 0
Views: 108
Reputation: 4759
This type of error happens because of mismatch between used dependencies and supported sdk versions.
Because bitcoin_ticker depends on cupertino_icons >=0.1.1 <1.0.1 which doesn't support null safety, version solving failed.
For e.g. here the cupertino_icons >=0.1.1 <1.0.1
doesn't support null safety and hence the error is very clear that to support null safety you must be on 2.12.0 or higher
The lower bound of "sdk: '<2.0.0 or >=2.0.0-dev.28.0 <3.0.0'" must be 2.12.0 or higher to enable null safety.
Now when I was facing the problem below was configuration in my pubspec.yaml
environment:
sdk: ">=2.1.0 <3.0.0"
Updated it to below
environment:
sdk: ">=3.1.4 <4.0.0"
Now because we have updated the sdk version, you should also use the latest version of cupertino_icons
cupertino_icons: ^1.0.6
Now it should work perfectly fine.
Upvotes: 0
Reputation: 202
Replace
environment:
sdk: '>=2.12.0 <3.0.0'
with
environment:
sdk: '>=3.1.1 <4.0.0'
Upvotes: 0