我的 Flutter 应用依赖于 intl_utils:^1.6.3,今天我将 Flutter 升级到最新的 Flutter (Channel master, 1.26.0-2.0.pre.86, on Mac OS X 10.15.4 19E287 darwin-x64, locale en-US)
。
现在,当我运行 pub get 时出现此错误:
Because every version of flutter_localizations from sdk depends on intl 0.17.0-nullsafety.2 and intl_translation >=0.17.7 depends on intl >=0.15.3 <0.17.0, flutter_localizations from sdk is incompatible with intl_translation >=0.17.7.
Because intl_utils >=1.6.3 <1.9.0 depends on intl_translation 0.17.10 and intl_utils >=1.9.0 depends on intl_translation 0.17.10+1, intl_utils >=1.6.3 requires intl_translation 0.17.10 or 0.17.10+1.
Thus, flutter_localizations from sdk is incompatible with intl_utils >=1.6.3.
So, because xxx depends on both flutter_localizations any from sdk and intl_utils ^1.6.3, version solving failed.
pub get failed (1; So, because xxx depends on both flutter_localizations any from sdk and intl_utils ^1.6.3, version solving failed.)
所以我添加了 intl: ^0.17.0-nullsafety.2
和 intl_translation: ^0.17.10+1
但现在我明白了
Because intl_translation >=0.17.7 depends on intl >=0.15.3 <0.17.0 and xxx depends on intl ^0.17.0-nullsafety.2, intl_translation >=0.17.7 is forbidden.
So, because xxx depends on intl_translation ^0.17.10+1, version solving failed.
pub get failed (1; So, because xxx depends on intl_translation ^0.17.10+1, version solving failed.)
然后我改为intl_translation: 0.17.6
,现在错误是:
Because intl_translation >=0.17.0 <0.17.7 depends on intl ^0.15.3 and xxx depends on intl ^0.17.0-nullsafety.2, intl_translation >=0.17.0 <0.17.7 is forbidden.
So, because gipi_partner depends on intl_translation 0.17.6, version solving failed.
pub get failed (1; So, because xxx depends on intl_translation 0.17.6, version solving failed.)
我正在尝试所有版本的组合,但都没有奏效。 我应该降级 Flutter 吗?
答案 0 :(得分:9)
一个临时解决方法,您可以覆盖 pubspec.yaml
中的依赖项
dependency_overrides:
intl: 0.17.0
答案 1 :(得分:2)
最好降级,新版本存在兼容性问题。