微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

面对 pubspec.yaml 中的问题

如何解决面对 pubspec.yaml 中的问题

当我在发布后将库 new_version: ^0.2.0 集成到项目中时,我收到此错误 -

Because new_version >=0.0.7 depends on package_info_plus ^1.0.0 which depends on package_info_plus_platform_interface ^1.0.0,new_version >=0.0.7 requires package_info_plus_platform_interface ^1.0.0.
And because package_info_plus_platform_interface >=1.0.0-nullsafety.1 depends on plugin_platform_interface ^2.0.0 and file_picker 2.1.6 depends on plugin_platform_interface ^1.0.1,new_version >=0.0.7 is incompatible with file_picker 2.1.6.
So,because fstore depends on both file_picker 2.1.6 and new_version ^0.2.0,version solving Failed.
pub get Failed (1; So,version solving Failed.)

我不明白这个Flutter版本问题还是sdk问题是什么意思???

这是 pubspec.yaml 文件,其中所有库都已为项目集成,如果我删除 new_version 库项目将工作得很好。

name: fstore
publish_to: "none"
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: 2.0.0+3001

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  Flutter:
    sdk: Flutter

  # COMMON
  inspireui:
    path: ./modules/common_library
  pedantic: 1.9.2
  rubber:
    git:
      url: git://github.com/inspireui/rubber
  country_pickers:
    git:
      url: git://github.com/inspireui/country_pickers.git


  # FIREBASE PACKAGES
  cloud_firestore: 0.14.4
  firebase_analytics: 6.3.0
  firebase_auth: 0.18.4+1
  firebase_core: 0.5.3
  firebase_database: 4.4.0
  firestore_ui: 1.12.0
  firebase_remote_config: ^0.4.3

  # STATE MANAGEMENT
  provider: 4.3.3

  # UI
  animated_splash: 1.0.0
  animated_text_kit: 3.1.2
  animations: 1.1.2
  awesome_card: 1.1.0
  carousel_pro: 1.0.0
  configurable_expansion_tile: 1.0.0
  country_code_picker: 1.7.0
  custom_splash: 0.0.2
  flare_splash_screen: 3.0.1
  rive: 0.6.8
  flash: 1.3.2
  Flutter_spinkit: 4.1.2+1
  Flutter_staggered_grid_view: 0.3.4
  Flutter_statusbarcolor: 0.2.3
  Flutter_swiper: 1.1.6
  visibility_detector: 0.1.5
  font_awesome_Flutter: 8.11.0
  image_picker: 0.6.7+15
  file_picker: 2.1.6
  multi_image_picker: 4.7.15
  intro_slider: 2.3.4
  liquid_swipe: 1.5.0
  page_indicator: 0.3.0
  percent_indicator: 2.1.9+1
  pin_code_fields: 6.1.0
  pull_to_refresh: 1.6.4
  rate_my_app: 0.7.2
  sticky_headers: 0.1.8+1
  zoom_widget: 0.1.3
  cupertino_icons: any

  # WEB TOOLS
  video_player: 2.0.0
  html_unescape: 1.0.2
  webview_Flutter: 2.0.1
  Flutter_widget_from_html: 0.6.0-rc.2021030401
  Flutter_webview_plugin: 0.3.11
  responsive_builder: 0.3.0


  # MAP
  google_maps_Flutter: 1.2.0
  location: 2.3.5 # use this version to compatible with fluxbuilder

  # STORAGE
  localstorage: 3.0.6+9 # depend on google font
  shared_preferences: 2.0.3

  # CONNECTIVITY
  connectivity: 2.0.2
  http: 0.13.0
  http_auth: 0.3.1

  uni_links: 0.4.0
  firebase_dynamic_links: 0.6.3


  # AUTHENTICATION
  apple_sign_in: 0.1.0
  Flutter_facebook_login: 3.0.0
  google_sign_in: 4.5.6


  # PUSH NOTIFICATION
  firebase_messaging: 7.0.3
  notification_permissions: 0.4.8
  onesignal_Flutter: 2.6.2

  # PAYMENTS
  stripe_sdk:
    git:
      url: git://github.com/inspireui/stripe-sdk.git
  razorpay_Flutter: 1.2.3

  # IMAGES
  extended_image:
    git:
      url: git://github.com/inspireui/extended_image.git

  transparent_image: 1.0.0

  # ADS
  facebook_audience_network: 0.7.1
  firebase_admob: 0.10.3

  # IN APP
  new_version: ^0.2.0



  # TOOLS
  auto_size_text: 2.1.0
  event_bus: 1.1.1
  google_fonts: 2.0.0
  random_string: 2.1.0
  share: 0.6.5+4
  sms_autofill: 1.3.1
  json_annotation: 3.1.1
  timeago: 3.0.1
  universal_platform: ^0.1.3
  uuid: 3.0.1
  validate: 1.7.0
  vector_math: any
  async: 2.5.0
  easy_debounce: 1.0.2
  jwt_decoder: 1.0.4
  charts_Flutter: 0.9.0
  Flutter_image_compress: ^0.7.0
  encrypt: 4.1.0
  adaptive_breakpoints: 0.0.3
  intl: 0.17.0

  # For Shopify GraphQL
  graphql: 3.1.0

  Flutter_localizations:
    sdk: Flutter

dev_dependencies:
  Flutter_test:
    sdk: Flutter
    version: any
  Flutter_launcher_icons: 0.8.1
  mockito: ^4.1.1 # Testing
  #To run json serializer,run:
  # Flutter pub run build_runner build --build-filter="lib/models/serializers/*.dart" --delete-conflicting-outputs
  # Flutter pub run build_runner serve --build-filter="lib/models/serializers/*.dart"
  build_runner: 1.11.1
  json_serializable: 3.5.1


### Override the library to support Flutter 2.0
### Note: This will show the warning but will not impact to the app features ?
dependency_overrides:
  intl: 0.17.0
  http: 0.13.0
  crypto: 3.0.0
  path_provider: 2.0.1
  uuid: 3.0.1
  http_parser: 4.0.0
  shared_preferences: 2.0.3
  pedantic: 1.9.2
  Flutter_svg: 0.19.3
  extended_image:
    git:
      url: git://github.com/inspireui/extended_image.git

  url_launcher: 6.0.1
  cached_network_image: 2.5.0
  fwfh_cached_network_image: ^0.6.0-rc.2021030401
  modal_bottom_sheet: 2.0.0-nullsafety.1



# 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/config/
    - lib/config/mocks/
    - lib/config/states/
    - lib/config/stories/
    - assets/icons/categories/
    - assets/icons/tabs/
    - assets/icons/payment/
    - assets/images/
    - assets/images/country/
    - assets/images/favicon/
    - assets/html/
    - assets/google_fonts/
  fonts:
    - family: Feather
      fonts:
        - asset: assets/fonts/Feather.ttf
    - family: SF Pro display
      fonts:
        - asset: assets/fonts/SF-Pro-display-Semibold.otf
          weight: 700

  # 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:
  #
  # For details regarding fonts from package dependencies,# see https://Flutter.io/custom-fonts/#from-packages
Flutter_intl:
  enabled: true

解决方法

您可以这样做以强制使用特定版本

dependency_overrides:
  package_info_plus_platform_interface: ^1.0.0

dependency_overrides:
  plugin_platform_interface: ^2.0.0
,

只需写下 new_version: any,即可获得 pub。之后,从pubspec.lock 获取合适的版本。你会得到解决方案。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?