pubspec.yaml has no lower-bound SDK constraint pubspec.yaml has no lower-bound SDK constraint flutter flutter

pubspec.yaml has no lower-bound SDK constraint


If you received this error even when your pubspec.yaml file contained the correct sdk line, be sure to check subfolders in your main folder. This was noted to happen while doing a flutter packages get from the font_awesome_flutter package. The reason was that even though the main pubspec.yaml contained the correct line, there was an offending example/pubspec.yaml. Add the lines to that file:

environment:  sdk: ">=2.7.0 <3.0.0"

Referenced issue.


As per the error instructions I added the following in my pubspec.yaml

environment:  sdk: '>=2.10.0 <3.0.0'

And then I executed flutter pub get and it's working fine now.


As of Dart 2.12, omitting the SDK constraint is an error. When the pubspec has no SDK constraint, pub get fails with a message like the following:

pubspec.yaml has no lower-bound SDK constraint.You should edit pubspec.yaml to contain an SDK constraint:(...)

For example, the following constraint says that this package works with any Dart SDK that’s version 2.10.0 or higher:

environment:  sdk: '>=2.10.0 <3.0.0'

For more information you can check the docs