Joris Hermans
Joris Hermans

Reputation: 191

Dependency problems in Dartlang

When I do a 'pub get' it gives me the following error:

Package uri has no versions that match >=0.9.3 <0.11.0 derived from: - rpc 0.5.5 depends on version >=0.9.3 <0.11.0

dependencies:
  angular2: 2.0.0-beta.1
  browser: ^0.10.0
  dart_to_js_script_rewriter: '^0.1.0'
  rpc: '^0.5.5'
  mongo_dart: '^0.2.4'
  http: '>=0.11.1 <0.12.0'
  crypto: '>=0.9.0 <0.10.0'
  _discoveryapis_commons: '>=0.1.0 <0.2.0'
  http_server: '^0.9.5+1'

uri has a version 0.10.0 and a version 0.11.0 https://pub.dartlang.org/packages/uri

How can I solve this dependency clash?

Upvotes: 2

Views: 462

Answers (1)

G&#252;nter Z&#246;chbauer
G&#252;nter Z&#246;chbauer

Reputation: 658037

The package name mentioned in the message is often misleading. What it actually tells is that pub somewhere gave up trying to find a compatible set.

Tools to debug are

What's easy to forget is the SDK constraint, which may limit package versions.

At first comment out all dependencies and add one by one until you can reproduce. Try to figure out which combination of packages prevent resolution (usually only 2 or 3). Then investigate their SDK version and dependency constraint.

Often it's related to the analyzer package which is moving fast and often introduces breaking changes, where on dependency requires a newer version and another dependency limits to older versions.

It can of course be any other package. Maybe one that wasn't updated since a while.

Adding

dependency_overrides:
  uri: ^0.11.0

To the pubspec.yaml fixes it, therefore the rpc package with the uri constraint really seems to be the culprit. Please create a bug report the get rpc made compatible with uri 0.11.0 or create a pull request.

Upvotes: 3

Related Questions