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.
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
- Pin the Flutter version in CI to one that satisfies the packages.
- Adjust conflicting constraints in pubspec.yaml.
- Commit pubspec.lock for reproducible resolution.
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.