Skip to content
Latchkey

Flutter "version solving failed" in CI

pub could not find a set of package versions that satisfy every constraint, often because a package requires a different Flutter or Dart SDK than the runner provides.

What this error means

flutter pub get fails with version solving failed, naming the package whose constraint conflicts with the SDK or another dependency.

flutter
Because myapp depends on some_pkg >=2.0.0 which requires SDK version >=3.4.0 <4.0.0,
version solving failed.
The current Dart SDK version is 3.2.0.

Common causes

Package requires a newer SDK

A dependency requires a Dart/Flutter SDK higher than the runner version.

Conflicting dependency constraints

Two packages require incompatible version ranges of a shared dependency.

How to fix it

Align the SDK and constraints

  1. Pin the Flutter version in CI to one that satisfies the packages.
  2. Adjust conflicting constraints in pubspec.yaml.
  3. Commit pubspec.lock for reproducible resolution.
pubspec.yaml
environment:
  sdk: '>=3.4.0 <4.0.0'
  flutter: '>=3.22.0'

Use flutter pub get with the locked versions

Resolve locally, commit pubspec.lock, and have CI install the locked set.

How to prevent it

  • Pin the Flutter/Dart version in CI to match pubspec constraints and commit pubspec.lock. Transient pub.dev fetch failures are auto-retried on managed runners.

Frequently asked questions

What causes ""version solving failed""?
A dependency requires a Dart/Flutter SDK higher than the runner version.
How do I fix "version solving failed"?
Align the SDK and constraints

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card