dart-lang / i18n

A general mono-repo for Dart i18n and l10n packages.
BSD 3-Clause "New" or "Revised" License
64 stars 39 forks source link

Dependency conflict (intl_translation and flutter_launcher_icons) #585

Closed R12-cookies closed 1 year ago

R12-cookies commented 3 years ago

whenever I add these two packages:

intl_translation
flutter_launcher_icons

to my pubspec.yaml and run "flutter pub get" I get the following error:


Because intl_translation >=0.16.1 depends on args >=0.12.1 <2.0.0 and flutter_launcher_icons 0.9.0 depends on args 2.0.0, intl_translation >=0.16.1 is incompatible with flutter_launcher_icons 0.9.0.
And because no versions of flutter_launcher_icons match >0.9.0 <0.10.0, intl_translation >=0.16.1 is incompatible with flutter_launcher_icons ^0.9.0.
So, because user depends on both flutter_launcher_icons ^0.9.0 and intl_translation ^0.17.10+1, version solving failed.
pub get failed (1; So, because user depends on both flutter_launcher_icons ^0.9.0 and intl_translation ^0.17.10+1, version solving failed.)

Now, I tried changing the version number of both packages but it wasn't that evident since I have a lot of other dependent packages in my pubspec.yaml

pubspec.yaml file:

name: user
description: A new Flutter application.

# 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+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  cupertino_icons: ^1.0.2
  intl: ^0.17.0
  json_annotation: ^4.0.1
  flutter_phoenix: ^1.0.0
  country_code_picker: ^2.0.1
  grouped_buttons: ^1.0.4
  google_fonts: ^2.0.0
  image_auto_slider: ^0.0.3
  image_slider: ^1.0.2
  pin_code_text_field: ^1.8.0
  page_transition: ^1.1.7+6
  shared_preferences: ^2.0.5
  toast: ^0.1.5
  circular_bottom_navigation: ^1.0.1
  carousel_slider: ^3.0.0
  url_launcher: ^6.0.3
  shimmer_animation: ^2.0.0
  path_provider: ^2.0.1
  horizontal_calendar_widget: ^1.0.2
  razorpay_flutter: ^1.2.5
  flutter_paystack: ^1.0.5+1
  flutter_share: ^2.0.0
  geolocator: ^7.0.3
  geocoder: ^0.2.1
  google_maps_flutter: ^2.0.3
  flutter_google_places: ^0.3.0
  flutter_local_notifications: ^5.0.0+1
  firebase_messaging: ^9.1.2
  sqflite: ^2.0.0+3
  progress_dialog: ^1.2.4
  image_picker: ^0.7.4
  flutter_datetime_picker: ^1.5.0
  flutter_html: ^1.3.0
  stripe_payment: ^1.0.11
  fbutton: ^2.0.1
  flutter_bloc: ^7.0.0
  firebase_auth: ^1.1.1
  firebase_core : ^1.0.4
  http_auth: ^1.0.0
  flutter_credit_card: ^2.0.0
  pdf: ^3.2.0
  flutter_full_pdf_viewer: ^1.0.6
  printing: ^5.1.0

dev_dependencies:
  flutter_test:
    sdk: flutter
  json_serializable: ^4.1.0
  flutter_launcher_icons: ^0.9.0
  change_app_package_name: ^1.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

dependency_overrides:
   intl: ^0.17.0-nullsafety.2

# The following section is specific to Flutter.
flutter_icons:
  android: "launcher_icon"
  ios: true
  image_path: "images/logos/logo_user.png"

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
  assets:
    - images/
    - images/account/
    - images/address/
    - images/custom/
    - images/footermenu/
    - images/icons/
    - images/logos/
    - images/maincategory/
    - images/veg/
    - images/veg/Sellers/
    - images/veg/Vegetables/
    - images/payment/
    - images/demosliderimage/
    - images/refernearn/
    - assets/
    - assets/category/
    - assets/products/
    - assets/restaurant/
    - assets/slider/
    - assets/user_profile/
    - assets/payment/
    - assets/onboarding/
    - assets/fonts/OpenSans-Regular.ttf
    - assets/fonts/OpenSans-Bold.ttf
    - assets/fonts/OpenSans-Italic.ttf
    - assets/fonts/OpenSans-BoldItalic.ttf

I am on dev channel and I have already upgraded all of my dependencies, I am also using the lastest version of flutter

flutter doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, 2.2.0-10.1.pre, on Microsoft Windows [version 10.0.19042.928], locale fr-FR)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[√] Chrome - develop for the web
[√] Android Studio (version 4.0)
[√] VS Code (version 1.55.2)      
[√] Connected device (3 available)

• No issues found!

How can I fix this?

petchgabriel commented 3 years ago

Any update on this problem?

RomanSoviak commented 3 years ago

Any updates?

R12-cookies commented 3 years ago

@petchgabriel @RomanSoviak Nope, sadly couldn't find a solution I ended up dropping intl_translation, and making drastic changes to my app.

alexobviously commented 3 years ago

Is this package being maintained any more? I've been waiting for a fix for two months so I think I'm going to have to drop it too now.

mehrdad-shokri commented 3 years ago

upgrading to args v2 should solve this problem. It's really surprising to see this repo is under dart-lang org!

mehrdad-shokri commented 3 years ago

Depending on your dependencies you can add dependency_overrides block and specify specific versions there.

rocboronat commented 3 years ago

@mehrdad-shokri may you add an example? It would be so useful 🎉

mehrdad-shokri commented 3 years ago

@rocboronat this is a segment of my dependencies section

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

and this is part of dev_dependencies

dev_dependencies:
  flutter_test:
    sdk: flutter
  intl_translation: ^0.17.10+1
  pedantic: ^1.9.0
  flutter_flavorizr: ^1.0.11

And this is a segment of dependency_overrides section

dependency_overrides:
  intl: ^0.17.0-nullsafety.2

By specifying intl: ^0.17.0-nullsafety.2 you stick to this specific version so if 2 (dev)dependencies conflict on version of a shared lib, you have specified what version to use