Package can't solving in pub after upgrade flutter

411

Hey I have also got this kinda issue many times. And there is only one solution is to provide range for packages. Eg:

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

Reason: Here your packages automatically choose stable package version.

Make sure to choose your left limit as lowest as possible version and right limit is latest version. You can check versions in version Section of Doc.

Share:
411
Mariam Younes
Author by

Mariam Younes

Updated on December 20, 2022

Comments

  • Mariam Younes
    Mariam Younes over 1 year

    In my app , I'm using Some packages

    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
    

    And now I have some error in my pub

    Because google_map_location_picker >=3.3.1 <4.1.3 depends on intl >=0.16.0 <=0.16.1 and every version of flutter_localizations from sdk depends on intl 0.17.0, google_map_location_picker >=3.3.1 <4.1.3 is incompatible with flutter_localizations from sdk.

    So, because food_app depends on both flutter_localizations any from sdk and google_map_location_picker 4.0.0, version solving failed. pub get failed (1; So, because food_app depends on both flutter_localizations any from sdk and google_map_location_picker 4.0.0, version solving failed.)

    and I'm trying to use any for packages and it makes more errors

    So , How can I deal with this problem !

  • Mariam Younes
    Mariam Younes about 3 years
    when I'm trying your solution I getting this error Because google_map_location_picker >=4.1.4 <4.1.7 depends on intl >=0.15.3 <=0.17.0-nullsafety.2 and google_map_location_picker >=3.3.1 <4.1.4 depends on intl_translation >=0.17.9 <=0.17.10, google_map_location_picker >=3.3.1 <4.1.7 requires intl >=0.15.3 <=0.17.0-nullsafety.2 or intl_translation >=0.17.9 <=0.17.10. And because intl_translation >=0.17.7 depends on intl >=0.15.3 <0.17.0 and every version of flutter_localizations depends on intl 0.17.0, flutter_localizations is incompatible with google_map_location_picker >=3.3.1 <4.1.7.
  • Kudos
    Kudos about 3 years
    Please share me your pub.ymal file updated code.