简体   繁体   中英

Flutter SDK not matching in pubspec.yaml

I am having some errors with my flutter project as seen below. I tried flutter upgrade, flutter clean, nothing is working to solve this issue.

Output from flutter pub get:

flutter pub get
Running "flutter pub get" in demo_app_1...                      
The current Dart SDK version is 2.14.4.

Because demo_app_1 depends on cloud_firestore >=3.1.10 which requires SDK version >=2.16.0 <3.0.0, version solving failed.
pub get failed (1; Because demo_app_1 depends on cloud_firestore >=3.1.10 which requires SDK version >=2.16.0 <3.0.0, version solving failed.)
exit code 1

flutter --version in terminal :

flutter --version
Flutter 3.1.0-0.0.pre.847 • channel master • https://github.com/flutter/flutter.git
Framework • revision 7459332538 (61 minutes ago) • 2022-05-21 02:33:07 -0400
Engine • revision 0264282e8b
Tools • Dart 2.18.0 (build 2.18.0-139.0.dev) • DevTools 2.13.1\

Thank you for your help.

in the pubspec.yaml you define the flutter sdk version (detailed information see here: Flutter and the pubspec file )

your importent part is the

environment:
  sdk: ">=2.7.0 <3.0.0"

here you define the sdk version and like the error message says, cloud_firestore requires a SDK version between 2.16.0 and 3.0.0

so you have to adjust these version to reach the requirements

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM