pubspec.yaml has no lower-bound SDK constraint. --> quite new to coding, I still can't find a good solution

71 Views Asked by At

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

environment: sdk: '^3.1.0'

this is an error code that keeps on popping up, and even if I change my sdk constraint, same error keeps happening.

name: <project name>
description: A new Flutter project.

publish_to: none

version: 1.0.0+1

environment:
  sdk: '>=3.2.0 <4.0.0'

dependencies:
  flutter:       # Required for every Flutter project
    sdk: flutter # Required for every Flutter project
  flutter_localizations: # Required to enable localization
    sdk: flutter         # Required to enable localization

  cupertino_icons: ^1.0.6 # Only required if you use Cupertino 
(iOS style) icons

dev_dependencies:
  flutter_test:
    sdk: flutter # Required for a Flutter project that includes 
tests

  flutter_lints: ^3.0.0 # Contains a set of recommended lints for 
Flutter code

flutter:

  uses-material-design: true # Required if you use the Material 
icon font

  generate: true # Enables generation of localized strings from 
arb files

  assets:  # Lists assets, such as image files
    - images/a_dot_burr.jpeg
    - images/a_dot_ham.jpeg

  fonts:              # Required if your app uses custom fonts
    - family: Schyler
      fonts:
        - asset: fonts/Schyler-Regular.ttf
        - asset: fonts/Schyler-Italic.ttf
          style: italic
    - family: Trajan Pro
      fonts:
        - asset: fonts/TrajanPro.ttf
        - asset: fonts/TrajanPro_Bold.ttf
          weight: 700

I am using a pupspec.yaml file from flutter doc, after all my tries of fixing the issue from my original file. Still doesn't work under the new pupspec file, and all of my codes from main.dart is not working.

what can I do?

0

There are 0 best solutions below