失败的'flutter pub get'-“因此,由于fstore依赖于sdk中的flutter_test,因此版本解析失败。”

时间:2020-10-05 18:30:38

标签: android ios xcode flutter

我最近将最新版本升级到Flutter。结果,我的应用程序将无法加载并立即失败。该错误似乎是由于Flutter版本引起的。我曾尝试降级,但没有成功。

这是控制台的输出。

Running "flutter pub get" in source...
Because every version of flutter_test from sdk depends on vector_math 2.1.0-nullsafety.3 and fstore depends on vector_math 2.0.8, flutter_test from sdk is forbidden.
So, because fstore depends on flutter_test any from sdk, version solving failed.
pub get failed (1; So, because fstore depends on flutter_test any from sdk, version solving failed.)

我尝试过更改开发频道并进行升级。这没用。 我改用稳定版并进行了升级-这也不起作用。 我试图降级并还原,但也没有用。

关于如何解决此问题的任何想法? -我有点新手编码!

我的pubspec.yaml是:

name: fstore
description: Mobile commerce app by Flutter

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.4.3+2

environment:
  sdk: ">=2.2.2 <3.0.0"

dependencies:
  logs:
    git: https://github.com/pq/logs
  flutter:
    sdk: flutter
  http: 0.12.1
  html_unescape: 1.0.1+3
  provider: 4.3.2
  flutter_signin_button: 1.0.0
  after_layout: 1.0.7+2
  font_awesome_flutter: 8.8.1
  vector_math: 2.0.8
  carousel_pro: 1.0.0
  flutter_widget_from_html: 0.4.3
  configurable_expansion_tile: 1.0.0
  timeago: 2.0.26
  share: 0.6.4+3
  validate: 1.7.0
  country_pickers: 1.3.0
  shared_preferences: 0.5.8
  firebase_messaging: 6.0.16
  firebase_analytics: 5.0.16
  transparent_image: 1.0.0
  pull_to_refresh: 1.6.1
  localstorage: 3.0.2+5
  notification_permissions: 0.4.7
  flare_splash_screen: 3.0.1
  rate_my_app: 0.7.0
  flutter_range_slider: 1.4.0
  page_indicator: 0.3.0
  extended_image: 1.1.0
  intro_slider: 2.3.1
  url_launcher: 5.4.11
  firebase_core: 0.4.5
  firebase_auth: 0.16.1
  firestore_ui: 1.10.0
  flutter_webview_plugin: 0.3.11
  connectivity: 0.4.9
  random_string: 2.1.0
  google_maps_flutter: 0.5.30
  place_picker: 0.9.14
  cached_network_image: 2.2.0+1
  image_picker: 0.6.7+4
  fab_circular_menu: 1.0.0
  uuid: 2.2.0
  uni_links: 0.4.0
  flutter_staggered_grid_view: 0.3.2
  auto_size_text: 2.1.0
  lazy_load_scrollview: 1.1.0
  flutter_swiper: 1.1.6
  flutter_widgets: 0.1.12
  video_player: 0.10.11+2
  flutter_spinkit: 4.1.2+1
  percent_indicator: 2.1.5
  page_view_indicators: 1.3.1
  animated_text_kit: 2.2.0
  wave: 0.0.8
  http_auth: 0.3.0
  international_phone_input: 1.0.4
  pin_code_fields: 5.0.0
  cupertino_icons: 0.1.3
  flutter_facebook_login: 3.0.0
  webview_flutter: 0.3.22+1
  rubber: 0.4.0
  flutter_localizations:
    sdk: flutter
  carousel_slider: 2.2.1
  flutter_ticket_widget: 0.0.1
  custom_splash: 0.0.2
  apple_sign_in: ^0.1.0
  firebase_database: 3.1.6
  google_sign_in: 4.5.1
  event_bus: 1.1.1

dependency_overrides:
  flutter_svg: 0.18.0

dev_dependencies:
  flutter_launcher_icons: 0.7.5
  flutter_test:
    sdk: flutter

# Run this script to generate the app icon: flutter pub run flutter_launcher_icons:main
flutter_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/images/app_icon.png"

# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  uses-material-design: true
  assets:
    - lib/common/config.json
    - assets/icons/categories/
    - assets/icons/tabs/
    - assets/icons/profile/
    - assets/icons/payment/
    - assets/images/
    - assets/images/country/
    - assets/images/categories/
    - assets/daymode.json
    - assets/nightmode.json

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.io/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.io/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  fonts:
    - family: Raleway
      fonts:
        - asset: assets/fonts/Raleway-Regular.ttf
        - asset: assets/fonts/Raleway-Medium.ttf
        - asset: assets/fonts/Raleway-Bold.ttf
        - asset: assets/fonts/Raleway-Light.ttf
        - asset: assets/fonts/Raleway-Thin.ttf
    - family: Roboto
      fonts:
        - asset: assets/fonts/Roboto-Regular.ttf
        - asset: assets/fonts/Roboto-Medium.ttf
        - asset: assets/fonts/Roboto-Bold.ttf
        - asset: assets/fonts/Roboto-Light.ttf
        - asset: assets/fonts/Roboto-Thin.ttf
    - family: Feather
      fonts:
        - asset: assets/fonts/Feather.ttf
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.io/custom-fonts/#from-packages
flutter_intl:
  enabled: true

1 个答案:

答案 0 :(得分:1)

错误:Because every version of flutter_test from sdk depends on...

意味着flutter_test依赖于版本低于您在另一个依赖项中指定的依赖项。

要解决此问题,请打开pubspec.yaml,然后删除问题依赖项的版本号:vector_math: 2.0.8 >> vector_math:

Because every version of flutter_test from sdk depends on... flutter_test from sdk is forbidden, version solving failed