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

Flutter集成Google Maps遇依赖版本冲突问题求助

解决Flutter中Google Maps集成的版本解析失败问题

由于search_map_place >=0.3.0依赖http ^0.12.0+4,而fluttermaps依赖http ^0.13.5,因此search_map_place >=0.3.0被禁用。
所以,由于fluttermaps依赖search_map_place 0.3.0,版本解析失败。
pub get failed (1; So, because fluttermaps depends on search_map_place 0.3.0, version solving failed.)

可行解决办法:

  • 降级http包版本
    修改pubspec.yaml中的http依赖为http ^0.12.0+4,与search_map_place要求的版本保持一致,之后执行flutter pub get。

  • 升级search_map_place到兼容版本
    检查search_map_place是否有更新版本支持http ^0.13.5,若存在,将pubspec.yaml里的search_map_place依赖改为对应版本(比如search_map_place: ^x.x.x,替换为实际兼容版本号),再执行flutter pub get。

  • 用dependency_overrides强制统一版本
    在pubspec.yaml末尾添加以下配置,强制让search_map_place使用http 0.13.5版本,注意这种方式可能存在兼容性风险,需要验证功能是否正常:

    dependency_overrides:
      http: ^0.13.5
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.22 16:15:41