【问题标题】:Because "flutter_app" depends on fluttertoast 4.0.2 which doesn't match any versions, version solving failed因为“flutter_app”依赖fluttertoast 4.0.2 不匹配任何版本,版本解析失败
【发布时间】:2023-04-03 20:20:02
【问题描述】:

因为“flutter_app”依赖fluttertoast 4.0.2 不匹配任何版本,版本解析失败。 这是我的 pubspec.yaml 文件

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: 0.1.2
  google_maps_flutter: 0.5.29
  google_map_location_picker: 3.3.3
  mvc_pattern: 6.1.3+2
  global_configuration: 1.5.0
  http: 0.12.2
  html: 0.14.0+3
  shared_preferences: 0.5.8
  flutter_html: 1.0.2
  flutter_svg: 0.18.0
  location: 3.0.2
  flutter_inappbrowser: 2.0.2
  url_launcher: 5.5.0
  firebase_messaging: 6.0.16
  cached_network_image: 2.2.0+1
  fluttertoast: 4.0.2
  flutter_staggered_grid_view: 0.3.2
  intl_utils: 1.6.3

dev_dependencies:
  flutter_test:
    sdk: flutter

我得到的错误是这样的

Because markets depends on fluttertoast 4.0.2 which doesn't match any versions, version solving failed.
Running "flutter pub get" in flutter_application...                     
pub get failed (1; Because markets depends on fluttertoast 4.0.2 which doesn't match any versions, version solving failed.)

【问题讨论】:

    标签: flutter dart flutter-dependencies dart-pub


    【解决方案1】:

    fluttertoast 最新版本是 7.0.2,

    由于您的几个包对我来说似乎已经过时,请尝试flutter pub outdated 查看最新版本的包并相应地更新更改您的 pubspec.yaml。

    如果它仍然存在,请对此答案发表评论。

    【讨论】:

    • 每当有任何答案解决了您的问题时,请务必将其标记为答案并点赞
    【解决方案2】:

    替换

    fluttertoast: 4.0.2
    

    fluttertoast: any
    

    【讨论】:

      猜你喜欢
      • 2019-12-25
      • 2021-02-19
      • 2019-08-03
      • 1970-01-01
      • 2020-10-17
      • 1970-01-01
      • 2022-07-15
      • 2020-10-15
      • 2013-07-08
      相关资源
      最近更新 更多