Skip to content
Latchkey

Dart/Flutter "version solving failed" in CI

Pub could not find a set of package versions that satisfies every constraint in pubspec.yaml at once. Two packages - or a package and your Dart/Flutter SDK constraint - demand incompatible versions.

What this error means

flutter pub get (or dart pub get) fails with "version solving failed", explaining which constraints conflict. It is deterministic and reproduces locally with the same pubspec.yaml.

pub output
Because app depends on both http ^1.2.0 and legacy_pkg 0.5.0 which depends on
http ^0.13.0, version solving failed.

Running "flutter pub get" in app... failed.

Diagnose it: SDK, signing, or simulator?

Mobile CI failures cluster into three: a missing or mismatched SDK component, a code-signing identity that does not exist on the runner, or a simulator or emulator that never became ready.

Terminal
# Android
sdkmanager --list_installed 2>/dev/null | head
echo "ANDROID_HOME=$ANDROID_HOME"
adb devices

# iOS
xcodebuild -version && xcrun simctl list devices available | head
security find-identity -v -p codesigning

Common causes

Incompatible package constraints

Two dependencies require non-overlapping versions of a shared package. Pub will not silently pick one - it reports the conflict.

An SDK constraint that excludes a release

Your environment: sdk: (or flutter:) bound may not overlap a package’s required SDK, leaving no solvable version.

How to fix it

Read the conflict and relax a constraint

  1. Identify the two requirements that conflict in the message.
  2. Loosen your own caret pin so the ranges overlap, if possible.
  3. If two third-party packages conflict, upgrade the lagging one to a release that accepts the newer shared dependency.

Let pub suggest an upgrade path

Terminal
dart pub get --verbosity=all
dart pub upgrade --major-versions

Align the SDK constraint

Make sure your environment bound overlaps every dependency’s requirement.

pubspec.yaml
environment:
  sdk: ">=3.4.0 <4.0.0"
  flutter: ">=3.24.0"

How to prevent it

  • Commit pubspec.lock for apps so CI installs the resolved set.
  • Keep your SDK constraint aligned with your dependencies’ support.
  • Upgrade related packages together to keep shared deps compatible.

Frequently asked questions

What causes Dart/Flutter "version solving failed" in CI?
There are 2 common causes: incompatible package constraints and an sdk constraint that excludes a release. Two dependencies require non-overlapping versions of a shared package.
How do I fix Dart/Flutter "version solving failed" in CI?
There are 3 fixes depending on which cause you have: read the conflict and relax a constraint, let pub suggest an upgrade path, and align the sdk constraint. Work through them in order, since the first is the most common.
What does Dart/Flutter "version solving failed" in CI actually mean?
flutter pub get (or dart pub get) fails with "version solving failed", explaining which constraints conflict.
How do I stop Dart/Flutter "version solving failed" in CI happening again?
Commit pubspec.lock for apps so CI installs the resolved set. The prevention section lists 3 changes that keep it from recurring.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card