# Flutter and Dart: “version solving failed”

> flutter pub get stops with version solving failed: two packages need versions of a shared dependency that don’t overlap. Read the Because lines.

Canonical: https://app369.com/fix/flutter-pub-version-solving-failed/
Last updated: 2026-11-08

flutter pub get or dart pub get prints a block of lines that start with Because, and ends with So, because your_app depends on both a ^1.0.0 and b ^2.0.0, version solving failed. Recent versions also print a suggested fix, such as Try upgrading your constraint on a. Pub could not find one version of every package that fits all the version ranges in your pubspec.yaml and in the packages you use. The Because lines name the packages that disagree.

**Short answer**

Read the Because lines: they name the two packages and the shared package they need different versions of. Raise the one that is behind in pubspec.yaml (flutter pub outdated shows what each can move to), or loosen your own constraint on the shared package. If the message says the current Dart SDK version is too old for a package, run flutter upgrade or pick an older version of that package. Use dependency_overrides only as a short bridge.

## **Why the versions don’t fit, and the fix**

1. 01 ### **Two packages need different versions of a shared one**
  > “This is called a shared dependency. Now what happens when widgets wants to use collection 2.3.5 and templates wants collection 2.3.7? What if they don't agree on a version?” [**Dart, Package versioning**](https://dart.dev/tools/pub/versioning) Package a needs intl ^0.19.0 and package b needs intl ^0.18.0, so no version is in both ranges. Upgrade the package that is behind, so both accept the same range. If it has no newer release, look for a fork or a replacement. The most common case is intl: flutter_localizations pins one exact version, so a package that wants another intl fails. Use the version Flutter pins (flutter pub add intl:any) and upgrade the other package.
2. 02 ### **Your pubspec holds a package on an old major version**
  > “Gets the packages that dart pub outdated lists as resolvable, ignoring any upper-bound constraint in the pubspec.yaml file. Also updates pubspec.yaml with the new constraints.” [**Dart, dart pub upgrade**](https://dart.dev/tools/pub/cmd/pub-upgrade) A constraint like http: ^0.13.0 keeps pub on 0.13.x, while a newer package you added needs 1.x. flutter pub upgrade --major-versions (dart pub in a plain Dart project) raises those constraints and rewrites pubspec.yaml. Commit first so you can undo it, then test the screens that use the upgraded packages.```
flutter pub outdated
flutter pub upgrade --major-versions
```
3. 03 ### **A package needs a newer Dart SDK** A line like which requires SDK version >=3.5.0 <4.0.0 means your Flutter install ships an older Dart. Run flutter upgrade, or pin the package to its last version that supports your SDK. In CI, use the same Flutter version as your machine.
4. 04 ### **dependency_overrides as a stopgap**
  > “You can use dependency_overrides to temporarily override all references to a dependency.” [**Dart, Package dependencies**](https://dart.dev/tools/pub/dependencies) Overriding the shared package makes pub use your version everywhere, even where a package says it isn’t compatible. Use it to unblock a build, then remove it once the packages catch up.```
dependency_overrides:
  collection: ^1.18.0
```

Checked against the vendor’s docs on November 8, 2026: [Dart: Package versioning (shared dependencies)](https://dart.dev/tools/pub/versioning); [Dart: dart pub outdated](https://dart.dev/tools/pub/cmd/pub-outdated); [Dart: dart pub upgrade](https://dart.dev/tools/pub/cmd/pub-upgrade); [Dart: Package dependencies (dependency_overrides)](https://dart.dev/tools/pub/dependencies).

## **Rather hand it over?**

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

- [from $450**App Fix Ticket**One reproducible bug in an existing mobile or web app, diagnosed and fixed.**See scope and start**](https://app369.com/fixed-price/flutter-firebase-bug-fix/)
- [from $450**AI-Built App Rescue**A Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.****No issues worth fixing, no charge.**** If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.**See scope and start**](https://app369.com/fixed-price/ai-app-rescue/)

Related: [**Flutter “requires a newer Kotlin Gradle plugin”**](https://app369.com/fix/flutter-kotlin-gradle-plugin-version/) · [**Flutter “Gradle task assembleDebug failed”**](https://app369.com/fix/flutter-gradle-assembledebug-failed/) · [**Flutter MissingPluginException**](https://app369.com/fix/flutter-missingpluginexception/) · [**Flutter pod install failed**](https://app369.com/fix/flutter-pod-install-failed/)

Questions

## **More on this error**

<details>

<summary>**Should I delete pubspec.lock? **+</summary>

It rarely fixes this error, because the conflict is between version ranges, not in the lock file, and it lets every package move at once. Change the constraint that conflicts instead.

</details>

<details>

<summary>**Why does it work on my machine but fail in CI? **+</summary>

Usually CI runs a different Flutter version, so a different Dart SDK. Pin the Flutter version in CI to the one you use locally.

</details>

<details>

<summary>**Can you fix it for me? **+</summary>

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

</details>

A different error?

## **Describe it and get a written quote**

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.

[**Describe your problem **→](https://app369.com/contact/) [**All fixes**](https://app369.com/fix/)