【问题标题】:Package can't solving in pub after upgrade flutter升级颤振后包无法在pub中解决
【发布时间】:2021-06-19 04:32:02
【问题描述】:

在我的应用中,我正在使用一些包

environment:
  sdk: ">=2.2.2 <3.0.0"
module:
  androidX: true

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    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
  google_maps_flutter: 1.0.3
  google_map_location_picker: 4.0.0
  mvc_pattern: 6.3.0
  global_configuration: 1.6.0
  http: 0.12.2
  html: 0.14.0+4
  shared_preferences: ^0.5.12+2
  flutter_html: 1.0.2
  flutter_svg: 0.18.1
  location: 3.0.2
  webview_flutter: 0.3.24
  url_launcher: 5.7.7
  firebase_messaging: 7.0.3
  cached_network_image: 2.3.3
  fluttertoast: 4.0.1
  flutter_staggered_grid_view: 0.3.2
  intl_utils: 1.8.0
  carousel_slider: 2.3.1
  cloud_firestore: 0.14.1+3
  firebase_auth: 0.18.1+2
  firebase_core: 0.5.0+1

现在我的酒吧出现了一些错误

因为 google_map_location_picker >=3.3.1 =0.16.0 =3.3.1

因此,由于 food_app 依赖于来自 sdk 和 google_map_location_picker 4.0.0 的任何 flutter_localizations,版本求解失败。 pub get failed (1; 所以,因为 food_app 依赖于来自 sdk 和 google_map_location_picker 4.0.0 的任何 flutter_localizations,版本解析失败。)

我正在尝试将 any 用于包,但它会产生更多错误

那么,我该如何处理这个问题!

【问题讨论】:

    标签: flutter dart package


    【解决方案1】:

    嘿,我也遇到过很多次这样的问题。只有一种解决方案是为包提供范围。 例如:

      flutter_polyline_points: ">=0.2.4 < 0.3.0"
      google_maps_flutter: ">=0.0.1 < 2.0.1"
    

    原因:这里你的包自动选择稳定包版本

    确保选择您的左限尽可能低的版本,右限是最新版本。 您可以在 Doc 的版本部分查看版本

    【讨论】:

    • 当我尝试您的解决方案时,我收到此错误因为 google_map_location_picker >=4.1.4 =0.15.3 =3.3.1 =0.17.9 =3.3.1 =0.15.3 =0.17.9 =0.17.7 依赖于 intl >=0.15.3 =3.3.1
    • 请分享您的 pub.ymal 文件更新代码。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-20
    • 2021-11-07
    • 2020-04-01
    • 2023-02-02
    • 2020-12-09
    • 1970-01-01
    • 2021-06-17
    相关资源
    最近更新 更多