Home > OS >  Flutter libraries incompatibility
Flutter libraries incompatibility

Time:10-21

I'm working on a flutter project which I'm not the one who developed it first time. After running pub get I have these massive amount of errors:

Because xdg_directories >=0.1.2 <0.2.0-nullsafety.0 depends on process >=3.0.12 <5.0.0 and xdg_directories <0.1.2 depends on process ^3.0.12, xdg_directories <0.2.0-nullsafety.0 requires process >=3.0.12 <5.0.0.
(1) So, because path_provider_linux <0.2.0-nullsafety depends on xdg_directories ^0.1.0, path_provider_linux <0.2.0-nullsafety requires process >=3.0.12 <5.0.0.

    Because process >=4.0.0-nullsafety.1 <4.0.0-nullsafety.4 requires SDK version >=2.10.0-0.0 <2.12.0 and process >=4.0.0-nullsafety.4 <4.0.0 depends on platform ^3.0.0-nullsafety.4, process >=4.0.0-nullsafety.1 <4.0.0 requires platform ^3.0.0-nullsafety.4.
    And because process >=3.0.12 <4.0.0-nullsafety.1 depends on intl >=0.14.0 <0.17.0 and process >=4.0.0 depends on platform ^3.0.0, process >=3.0.12 requires platform ^3.0.0-nullsafety.4 or intl >=0.14.0 <0.17.0.
(2) So, because path_provider_linux <0.2.0-nullsafety requires process >=3.0.12 <5.0.0 (1), path_provider_linux <0.2.0-nullsafety requires platform ^3.0.0-nullsafety.4 or intl >=0.14.0 <0.17.0.

    Because shared_preferences_linux <=0.0.2 depends on path_provider ^1.6.11 and shared_preferences_linux >=0.0.4-nullsafety <2.0.0 depends on shared_preferences_platform_interface ^2.0.0-nullsafety, shared_preferences_linux <0.0.2 1 or >=0.0.4-nullsafety <2.0.0-∞ requires path_provider ^1.6.11 or shared_preferences_platform_interface ^2.0.0-nullsafety.
    And because shared_preferences_linux >=0.0.2 1 <0.0.4-nullsafety depends on path_provider_linux ^0.0.1 and path_provider >=1.6.10 <2.0.0-nullsafety depends on path_provider_linux ^0.0.1, shared_preferences_linux <2.0.0 requires shared_preferences_platform_interface ^2.0.0-nullsafety or path_provider_linux ^0.0.1.
    And because path_provider_linux <0.2.0-nullsafety requires platform ^3.0.0-nullsafety.4 or intl >=0.14.0 <0.17.0 (2), shared_preferences_linux <2.0.0 requires platform ^3.0.0-nullsafety.4 or intl >=0.14.0 <0.17.0 or shared_preferences_platform_interface ^2.0.0-nullsafety.
    And because every version of flutter_localizations from sdk depends on intl 0.17.0 and shared_preferences >=0.5.8 <2.0.0-nullsafety depends on shared_preferences_linux ^0.0.2, if flutter_localizations any from sdk and shared_preferences >=0.5.8 <2.0.0-nullsafety then platform ^3.0.0-nullsafety.4 or shared_preferences_platform_interface ^2.0.0-nullsafety.
    And because shared_preferences >=0.5.4 8 <2.0.0-nullsafety depends on shared_preferences_platform_interface ^1.0.0 and every version of localize_and_translate depends on flutter_localizations any from sdk, if shared_preferences >=0.5.8 <2.0.0-nullsafety and localize_and_translate any then platform ^3.0.0-nullsafety.4.
    And because localize_and_translate ^3.0.3 depends on shared_preferences ^0.5.12 4 and firebase_messaging >=0.2.0 <7.0.2 depends on platform ^2.0.0, localize_and_translate ^3.0.3 is incompatible with firebase_messaging >=0.2.0 <7.0.2.
    So, because educationtqnia depends on both firebase_messaging ^6.0.13 and localize_and_translate ^3.0.3, version solving failed.
pub get failed (1;     So, because educationtqnia depends on both firebase_messaging ^6.0.13 and localize_and_translate ^3.0.3, version solving failed.)
Process finished with exit code 1

This is my pubspec-yaml file:

name: educationtqnia
description: education_tqnia

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# 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.0.0 7

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  permission_handler: ^5.0.0 hotfix.4
  dio: ^3.0.8
  firebase_messaging: ^6.0.13
  flutter_local_notifications: ^1.1.3
  connectivity: ^0.4.8 2
  video_player: ^0.10.9 1
  image_picker: ^0.6.5 3
  cupertino_icons: ^0.1.3
  http: ^0.12.0 2
  flutter_launcher_icons: ^0.7.2 1
  flutter_rounded_date_picker: 0.3.0
  rflutter_alert: ^1.0.2
  intro_slider: ^2.2.9
  font_awesome_flutter: ^8.8.1
  shared_preferences: ^0.5.6 3
  fluttertoast: ^4.0.0
  percent_indicator: ^2.1.1 1
  responsive_builder: ^0.1.5
  chewie: ^0.9.10
  wc_flutter_share: ^0.2.0
  flutter_record: ^0.4.3 1
  cached_network_image: ^2.2.0
  gradient_text: ^1.0.2
  flutter_youtube: "^2.0.0"
  flutter_pdfview: ^1.0.3 2
  url_launcher: ^5.5.0
  webview_flutter: ^1.0.7
  full_screen_image: any
  

dev_dependencies:
  flutter_test:
    sdk: flutter
  localize_and_translate: ^3.0.3
  

flutter_icons:
  android: "launcher_icon" 
  ios: true
  image_path: "assets/icon/icon.png"

flutter_zoom_plugin:
      git:
        url: git://github.com/decodedhealth/flutter_zoom_plugin.git
        ref: 0.0.8

# 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:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
   - langs/ar.json
   - langs/en.json
   - assets/


  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/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: Cairo
    fonts:
    - asset: assets/fonts/Cairo-Black.ttf
    - asset: assets/fonts/Cairo-Bold.ttf
    - asset: assets/fonts/Cairo-ExtraLight.ttf
    - asset: assets/fonts/Cairo-Light.ttf
    - asset: assets/fonts/Cairo-Regular.ttf
    - asset: assets/fonts/Cairo-SemiBold.ttf
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

I tried downgrading the flutter SDK, switching between channels and running changing the libraries version to solve the problem but nothing work. Any ideas how to solve this problem? Thanks.

CodePudding user response:

This problem is very common when Flutter or some plugins have been updated. The only thing that works for me is to update everything, both flutter and the plugins to their latest version and if one is incompatible because it has no maintenance, try to change it for another.

CodePudding user response:

Adding to Miguels answers - you could file issues on the relevant libraries GitHub pages if you need them to be usable on the newest flutter version aswell as compatible with other libraries.

  • Related