Jason Simard
Jason Simard

Reputation: 133

Flutter dependencies problems

I am stuck with dependencies error and i can't figure how i can solve it.

Here are my plugins

version: 2.0.0+37

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  firebase_core: ^1.0.0
  shared_preferences: ^2.0.3
  cloud_firestore: ^1.0.0
  firebase_auth: ^1.0.0
  firebase_auth_web: ^1.0.0
  material_design_icons_flutter: ^4.0.5955
  google_fonts: ^2.0.0
  table_calendar: ^2.3.3
  flutter_calendar_week:
    git:
      url: https://github.com/mduccc/flutter_calendar_week
      ref: 0.4.1
  intl: ^0.17.0
  flutter_datetime_picker: ^1.5.0
  flutter_reaction_button: ^1.0.7+3
  nanoid: ^1.0.0
  flutter_spinkit: ^5.0.0
  awesome_dialog: ^1.3.2
  flutter_animated_dialog: ^1.2.0
  flutter_staggered_grid_view: ^0.3.4
  flutter_colorpicker: ^0.3.4
  expandable: ^4.1.4
  firebase_analytics: ^7.1.0
  firebase_analytics_web: ^0.2.0
  http_parser: ^4.0.0
  google_mobile_ads: ^0.11.0+2
  purchases_flutter: ^3.0.0
  url_launcher: ^6.0.2
  firebase_messaging: ^9.0.0
  flushbar: ^1.10.4
  i18n_extension: ^4.0.0
  syncfusion_flutter_core: ^18.4.46
  syncfusion_flutter_calendar: ^18.4.46
  syncfusion_flutter_datepicker: ^18.4.46-beta
  syncfusion_localizations: ^18.4.46
  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: ^0.9.0

And here is my error since i have firebase: ^9.0.0

Running "flutter pub get" in projetge...                        
Because every version of firebase_analytics_web depends on firebase ^7.3.0 which depends on http_parser ^3.0.0, every version of firebase_analytics_web requires http_parser ^3.0.0.

So, because projetge depends on both firebase_analytics_web ^0.2.0 and http_parser ^4.0.0, version solving failed.
pub get failed (1; So, because projetge depends on both firebase_analytics_web ^0.2.0 and http_parser ^4.0.0, version solving failed.)
exit code 1

So if i understand well i need to go lower on firebase plugins but if i do so i will get other plugins dependencies errors so i am totally stuck. Do i have to wait for firebase_analytics_web to get updated? It doesn't make sense, maybe we can skip dependencies or get 2 versions of one plugins ?

Upvotes: 0

Views: 1270

Answers (4)

Anas Naguib
Anas Naguib

Reputation: 1116

You can use dependency_overrides after your dependencies

dependency_overrides
  http_parser: ^4.0.0

Upvotes: 1

Jason Simard
Jason Simard

Reputation: 133

The error is solved using the commande : flutter pub upgrade

The tool found the perfect combinaison i needed. Thanks flutter

Upvotes: 0

Tipu Sultan
Tipu Sultan

Reputation: 1865

use http_parser ^3.0.0 instead of http_parser ^4.0.0. Because you are using firebase_analytics_web: ^0.2.0 and this is the latest version of it that's why you need to change the version of http_parser.

Upvotes: 1

KuKu
KuKu

Reputation: 7492

Using 'flutter pub outdated' command, you can find solution of dependencies.
If that command suggest that there is proper solution,
you need to package's update.

enter image description here

Upvotes: 2

Related Questions