You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter依赖版本解析失败,求助解决intl版本冲突问题

依赖版本冲突解决办法

遇到的错误:

因为u_lo_musico_v3依赖awesome_calendar ^1.1.3,而该版本的awesome_calendar需要intl ^0.17.0,因此必须使用intl ^0.17.0。
但你的项目u_lo_musico_v3又依赖intl ^0.18.0,导致版本解析失败。

可行的解决方法:

  • 降低intl版本:把pubspec.yaml里的intl依赖改为intl: ^0.17.0,然后执行flutter pub get。如果你的项目没用到intl 0.18.0的新特性,这是最稳妥的方案。
  • 升级awesome_calendar:查看awesome_calendar的最新版本,确认是否已经支持intl 0.18.x。若有兼容版本,将pubspec.yaml中的awesome_calendar依赖更新为对应版本,再执行flutter pub get。
  • 强制统一版本(需测试兼容性):在pubspec.yaml中添加dependency_overrides块,指定统一的intl版本,示例如下:
    dependency_overrides:
      intl: ^0.17.0
    
    添加后执行flutter pub get,但要注意这种方式可能引发awesome_calendar的兼容问题,务必充分测试项目功能。

内容的提问来源于stack exchange,提问作者Mus

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 02:49:57