Search code examples
firebasefluttervisual-studio-codepubspec

Getting package version conflicts while installing Flutter packages


I am trying to install a package jitsi_meet: ^4.0.0 in pubspec.yaml, while I am installing, I am getting this error with the termination of installation:

Running "flutter pub get" in edaffix-mobile-flutter-master...     
Because jitsi_meet >=4.0.0 depends on jitsi_meet_platform_interface ^2.0.0 which depends on plugin_platform_interface ^2.0.0, jitsi_meet >=4.0.0 requires plugin_platform_interface ^2.0.0.
And because firebase_storage_platform_interface 1.0.4 depends on plugin_platform_interface ^1.0.0 and no versions of firebase_storage_platform_interface match >1.0.4 <2.0.0, jitsi_meet >=4.0.0 is incompatible with firebase_storage_platform_interface ^1.0.4.
And because firebase_storage 7.0.0 depends on firebase_storage_platform_interface ^1.0.4 and no versions of firebase_storage match >7.0.0 <8.0.0, jitsi_meet >=4.0.0 is incompatible with firebase_storage ^7.0.0.
So, because edaffix depends on both firebase_storage ^7.0.0 and jitsi_meet ^4.0.0, version solving failed.



pub get failed (1; So, because edaffix depends on both firebase_storage ^7.0.0 and jitsi_meet ^4.0.0, version solving failed.)
exit code 1

my pubspec.yaml file is

version: 1.1.1+3

environment:
  sdk: '>=2.6.0 <3.0.0'

dependencies:
  flutter:
    sdk: flutter
  firebase_core: '^0.7.0'
  firebase_auth: '^0.20.1'
  firebase_crashlytics: '^0.4.0+1'
  cloud_firestore: '^0.16.0+1'
  cloud_functions: '^0.9.0'
  firebase_storage: '^7.0.0'
  firebase_messaging: '^8.0.0-dev.15'
  cached_network_image: ^2.0.0
  timeago: ^2.0.26
  shared_preferences: ^0.5.6+3
  carousel_slider: ^1.4.1
  video_player: ^0.10.11+1
  chewie: ^0.9.10
  image_cropper: ^1.2.3
  image_picker: ^0.6.7+2
  flutter_offline: '^0.3.0'
  percent_indicator: '^2.1.5'
  jitsi_meet: ^4.0.0
  jiffy: ^3.0.1
  intl: ^0.16.1
  flutter_datetime_picker: ^1.3.8
  timeline_tile: ^1.0.0
  flutter_full_pdf_viewer: ^1.0.6
  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter

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

# The following section is specific to Flutter.
flutter:
  uses-material-design: true

I tried to install plugin_platform_interface: '^1.0.0 as an extra dependency but is not working. How can I solve this?


Solution

  • You can downgrade the jitsi_meet package to version ^2.1.0 and the error should disappear.

    I got the version number by:

    1. Leaving the jitsi_meet version as empty like this:
    jitsi_meet:
    

    This makes pub get the best compatible version of the package.

    1. Searching the pubspec.lock file for jitsi_meet. There I saw this code block:
    jitsi_meet:
      dependency: "direct main"
      description:
        name: jitsi_meet
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.0"
    

    This means pub resolved the version number to 2.1.0

    1. Specifying the version number in the pubspec.yaml file like this:
    jitsi_meet: ^2.1.0