如何在 Android Studio 中升级 http 依赖

时间:2021-03-05 04:02:07

标签: android firebase flutter android-studio upgrade

flutter pub 获取:

Because firebase_auth >=1.0.0 depends on firebase_auth_web ^1.0.0 which depends on http_parser ^4.0.0, firebase_auth >=1.0.0 require
s http_parser ^4.0.0.
And because http 0.12.2 depends on http_parser >=0.0.1 <4.0.0 and no versions of http match >0.12.2 <0.13.0, firebase_auth >=1.0.0 i
s incompatible with http ^0.12.2.
So, because p1 depends on both http ^0.12.2 and firebase_auth ^1.0.0, version solving failed.
Running "flutter pub get" in p1...
pub get failed (1; So, because p1 depends on both http ^0.12.2 and firebase_auth ^1.0.0, version solving failed.)

我刚刚运行了 flutter upgrade,所以我的 flutter 和 dart 包是最新的,并且通过 sdk 管理器(在工具中)我安装了 android 10 和 11 以及所需的 sdk 工具。 Android Studio 没有针对开发频道的待定更新。 (2021 年 3 月 5 日) Firebase 版本是昨天才包含的。

dependencies:
  http: "^0.12.2"
  flutter:
    sdk: flutter


 
  cupertino_icons: ^1.0.0
  firebase_core: ^1.0.0
  firebase_auth: ^1.0.0
  firebase_database: ^6.1.0

如果我遗漏了一些东西,我深表歉意。

编辑:是的,我完全错过了。我只需要在 pub.get 中查找 http 然后更改版本。 (最新:http: "^0.13.0") 如有需要请删除。

1 个答案:

答案 0 :(得分:1)

解决方案:我将依赖项 (pubspec.yaml) 中的 http 版本从旧版本更改为 http:"^0.13.0"(最新至 2021 年 3 月 5 日)(获取版本从 pub.dev 并输入 http,转到安装选项卡,您将在那里找到版本)。

然后运行 ​​flutter pub get 或任何适合您需求的程序。

我当前的依赖项:

dependencies:
  http: "^0.13.0"
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.0
  firebase_core: ^1.0.0
  firebase_auth: ^1.0.0
  firebase_database: ^6.1.0

如果有其他人想分享任何相关的东西,请做!谢谢。