Dart pub: The current Dart SDK version is 2.19.0. Because app requires SDK version >=3.0.0 <4.0.0, version solving failed
A package (or your own pubspec) requires a newer Dart SDK than the one your Flutter installation provides.
The current Dart SDK version is Because app requires SDK version >=Because requires SDK version >=3.0.0 <4.0.0, version solving failedThe current Dart SDK version is 2.19.0requires SDK version >=3.3.0 <4.0.0 Meaning
Upgrade Flutter (flutter upgrade) or lower the dependency version/environment: sdk: range. The first line shows your current SDK version; compare it with the required range. CI may be using a different Flutter version than local.
Common causes
- Old Flutter/Dart SDK installed
- pubspec environment.sdk higher than installed
- Package updated to require Dart 3
- CI using a cached older Flutter
- Multiple Flutter installs (FVM) with wrong version
⚡ Quick fix
flutter upgradeorflutter channel stable- Pin an older package version compatible with your SDK
- Use FVM / CI to fix the Flutter version consistently
Detailed fix by platform
Flutter
flutter --versionshows Dart SDK;fvm use 3.22.0pins the project version
How to diagnose
- SDK — Installed version?
- Range — pubspec constraint?
- CI — Same Flutter?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Android license status unknown / licenses not accepted flutter doctor: Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses
- BoxConstraints forces an infinite width Flutter: BoxConstraints forces an infinite width. These invalid constraints were provided to RenderStack's layout() function (TextField in a Row)
- Cleartext HTTP traffic not permitted Flutter (Android): java.io.IOException: Cleartext HTTP traffic to api.example.com not permitted
Most viewed in Flutter / Dart
- setState() called after dispose() Flutter: setState() called after dispose(): _MyState#1a2b3 (lifecycle state: defunct, not mounted)
- A RenderFlex overflowed Flutter: A RenderFlex overflowed by x pixels on the right/bottom
- Null check operator used on a null value Dart/Flutter: Null check operator used on a null value
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026