Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Flutter and app store releases

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 show

Fix it fast

Most common cause, 1 of 3

A 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.

Fix
git add pubspec.yaml pubspec.lock && git commit -m "before major upgrades"
flutter pub upgrade --major-versions
flutter test
Did this fix it?
Full steps for this cause: check, fix, verify

Short 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.

  • Applies to Flutter 3.50.1 (stable), Dart 3.14.0
  • Updated
  • By Maaz Zindani, Senior Software Engineer

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.

Run this first
flutter pub outdated

Then find the line you see in this list and open its fix:

  1. 1A caret range in your pubspec.yaml stops at the current major versionThe package sits under direct dependencies, and its Resolvable value is higher than its Upgradable value
  2. 2A package you depend on still requires an older releaseThe package appears only under transitive dependencies, with Resolvable lower than Latest
  3. 3The Flutter SDK pins exact versions of its test packagespub 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.

Check
flutter pub upgrade --major-versions --dry-run

Fix

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.

Fix
git add pubspec.yaml pubspec.lock && git commit -m "before major upgrades"
flutter pub upgrade --major-versions
flutter test

Verify

flutter pub outdated no longer lists that package, or lists it with Resolvable equal to Latest and Current.

Verify
flutter pub outdated

Confirmed by dart.dev

Did this fix it?

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.

Check
flutter pub deps -s list

Fix

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.

Fix
flutter pub outdated
flutter pub upgrade

Verify

pub outdated reports that dependencies are on the latest resolvable versions, even if the count in the notice stays the same.

Verify
flutter pub outdated --transitive

Confirmed by dart.dev

Did this fix it?

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.

Check
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.

Fix
flutter upgrade
flutter pub get

Verify

After the Flutter upgrade, pub outdated shows the new pinned versions in Current, and your widget tests still pass.

Verify
flutter test

Confirmed by raw.githubusercontent.com

Did this fix it?

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.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.