Pub get failed, [1] Resolving dependencies… Incomp

2019-07-08 21:58发布

问题:

Below is my pubspec.yaml file

name: MyApp
description: A sample command-line application
dependencies:
  csv_sheet: any
  redstone: any
  shelf_static: any
  browser: any
  angular: ">=0.14.0 <0.15.0"
  polymer: ">=0.13.0"
  core_elements: ">=0.2.0+1"
  paper_elements: ">=0.1.1+2"

I am getting the follow error

Pub get failed, [1] Resolving dependencies...
Incompatible version constraints on code_transformers:
- angular 0.14.0 depends on version >=0.1.4+2 <0.2.0
- polymer 0.13.0 depends on version >=0.2.0 <0.3.0

So angular and polymer are using different version of code_transformers.

Is there a combination of angular and polymer version constraint that will make my pubspec.yaml work?

回答1:

You can add

dependency_overrides:
  code_transformers: '>=0.2.0 <0.3.0'

to your pubspec.yaml file.

This is at your own risk as Angular is not tested with this code_transformers version.
As alternative you can use an older version of Polymer or wait for the next Angular release.