pub get says some packages have newer versions it cannot use
Your error
3 packages have newer versions incompatible with dependency constraints.2 more lines it can showFix it fast
Most common cause, 1 of 3A caret range in your pubspec.yaml stops at the current major version
Commit pubspec.yaml first, read the package changelog for breaking changes, then let pub raise the constraints to the resolvable versions and run your tests.
git add pubspec.yaml pubspec.lock && git commit -m "before major upgrades"
flutter pub upgrade --major-versions
flutter testShort answer
“3 packages have newer versions incompatible with dependency constraints” is a notice from pub get, not a failure. Newer releases exist, but your pubspec.yaml caret ranges, another package, or the Flutter SDK's exact pins keep them out. Run flutter pub outdated and upgrade only direct dependencies whose Resolvable column is ahead. Applies to Flutter 3.50 and Dart 3.14.
Which cause do you have?
Ask pub which packages are behind and why. The four version columns show, for each one, what your pubspec allows, what could resolve, and what is published.
flutter pub outdatedThen find the line you see in this list and open its fix:
- 1A caret range in your pubspec.yaml stops at the current major version
The package sits under direct dependencies, and its Resolvable value is higher than its Upgradable value - 2A package you depend on still requires an older release
The package appears only under transitive dependencies, with Resolvable lower than Latest - 3The Flutter SDK pins exact versions of its test packages
pub deps shows the held-back package (test_api, matcher) under flutter_test
What does the error look like?
3 packages have newer versions incompatible with dependency constraints.Try `flutter pub outdated` for more information.Try `dart pub outdated` for more information.
Cause 1 of 3
A caret range in your pubspec.yaml stops at the current major version
You seeThe package sits under direct dependencies, and its Resolvable value is higher than its Upgradable value
Check
The pub notice about newer versions incompatible with dependency constraints often comes from your own pubspec.yaml. A range such as ^2.1.0 never accepts 3.0.0, so pub counts the package as held back. Upgradable is the newest version your range allows; Resolvable is the newest one that would still fit every other package.
flutter pub upgrade --major-versions --dry-runFix
Commit pubspec.yaml first, read the package changelog for breaking changes, then let pub raise the constraints to the resolvable versions and run your tests.
git add pubspec.yaml pubspec.lock && git commit -m "before major upgrades"
flutter pub upgrade --major-versions
flutter testVerify
flutter pub outdated no longer lists that package, or lists it with Resolvable equal to Latest and Current.
flutter pub outdatedConfirmed by dart.dev
Cause 2 of 3
A package you depend on still requires an older release
You seeThe package appears only under transitive dependencies, with Resolvable lower than Latest
Check
Sometimes nothing in your own file holds the version back. One of your dependencies declares a range that excludes the new release, so the best version all packages can share is older than the one on pub.dev. Listing the dependency tree shows which parent pulls it in.
flutter pub deps -s listFix
Upgrade the parent package if a newer release relaxes its range; otherwise leave it. Once pub upgrade has run, the notice is safe to ignore here: the lock file already holds the newest version that fits everything.
flutter pub outdated
flutter pub upgradeVerify
pub outdated reports that dependencies are on the latest resolvable versions, even if the count in the notice stays the same.
flutter pub outdated --transitiveConfirmed by dart.dev
Cause 3 of 3
The Flutter SDK pins exact versions of its test packages
You seepub deps shows the held-back package (test_api, matcher) under flutter_test
Check
flutter_test in the stable SDK lists test_api and matcher at exact versions, not ranges, because it relies on their internal details. Any app with flutter_test in dev_dependencies inherits those pins, so newer releases of them count as incompatible until a Flutter release moves the pin.
flutter pub deps -s list | grep -E "test_api|matcher"Fix
Leave these alone. Do not force them with dependency_overrides; move to a newer Flutter release instead, which brings its own updated pins.
flutter upgrade
flutter pub getVerify
After the Flutter upgrade, pub outdated shows the new pinned versions in Current, and your widget tests still pass.
flutter testConfirmed by raw.githubusercontent.com
How do I stop it coming back?
- Keep the app's pubspec.lock under version control; CI then counts held-back packages against the same resolution you see locally.
- Run flutter pub upgrade --major-versions --dry-run on a branch each release cycle and merge only after tests pass.
- Keep dependency_overrides empty in committed code, and check with pub outdated --no-dependency-overrides when one is needed for a short time.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine on the same stack: TaxiDex, Qist Bazaar, SessionBird.