Flutter 2 升级依赖失败

时间:2021-03-04 14:35:14

标签: flutter

我大家, 我升级到 flutter 2,但出现此错误:

Because geoflutterfire 2.2.1 depends on rxdart ^0.24.1 and no versions of geoflutterfire match >2.2.1 <3.0.0, geoflutterfire ^2.2.1 requires rxdart ^0.24.1.
So, because sample_app depends on both rxdart ^0.26.0 and geoflutterfire ^2.2.1, version solving failed.
pub get failed (1; So, because sample_app depends on both rxdart ^0.26.0 and geoflutterfire ^2.2.1, version solving failed.)

颤振医生:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.0, on macOS 11.1 20C69 darwin-x64, locale en-IL)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[!] Xcode - develop for iOS and macOS
    ! CocoaPods 1.9.1 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Community Edition (version 2019.1)
[✓] Connected device (2 available)

1 个答案:

答案 0 :(得分:4)

已解决:

dev_dependencies 下方添加此行

dependency_overrides:
  plugin_platform_interface: '>=2.0.0'
  intl: '>=0.17.0'
  http: '>=0.13.0'
  quiver: '>=2.0.0'
  http_parser: '>=4.0.0'
  path_provider: '>=2.0.1'
  flutter_cache_manager: '>=2.1.1'
  rxdart: '>=0.26.0'

**注意事项 不要复制我的覆盖依赖项,而是查看您遇到的错误,然后覆盖它。 此外,您需要关注这些插件的任何更新,如果修复,则删除覆盖依赖项。