Failed 'flutter pub get' - "So, because fstore depends on flutter_test any from sdk, version solving failed."

8,294

Error: Because every version of flutter_test from sdk depends on...

Means flutter_test depends on a dependency with version lower than you specified in another dependency.

To solve this, open pubspec.yaml, and remove the version number of the problem dependency: 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

Share:
8,294
Admin
Author by

Admin

Updated on December 24, 2022

Comments

  • Admin
    Admin over 1 year

    I've recently upgraded to Flutter the latest version. As a result, my app won't load and fails instantly. The error seems to be due to the Flutter version. I've tried to downgrade but this wasn't successful.

    Here's the output of the console.

    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.)
    

    I've tried changing to dev channel and upgrading. This didn't work. I switched to stable and upgraded - this also didn't work. I've tried to downgrade and revert back, which also hasn't worked.

    Any ideas as to how to fix this? - I'm a bit of a newbie coder!

    My pubspec.yaml is the following:

    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