Abbas Asadi
Abbas Asadi

Reputation: 344

flutter failed to import dependencies

I clone a project from git. the code is for a long time before and seems dependencies are not updated, so I stick in the problem with dependencies. I update every dependency to the latest version. this is my pubspec.yaml code:

environment:
  sdk: ">=2.12.0 <3.0.0"

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.3
  optimized_cached_image: ^2.0.1
  cached_network_image: ^3.0.0
  flutter_cache_manager: ^3.1.2 #for cached_network_image
  http: ^0.13.3
  provider: ^5.0.0
  connectivity: ^3.0.6
  dynamic_theme: ^1.0.1
  sembast: ^3.1.0+2
  path_provider: ^2.0.2
  intl: ^0.17.0
  shimmer: ^2.0.0
  url_launcher: ^6.0.9
  carousel_slider: ^4.0.0
  firebase_core: ^1.3.0
  firebase_messaging: ^10.0.3
  # firebase_auth: 0.16.0 # firebase_auth is for phone login
  flutter_webview_plugin: ^0.4.0
  firebase_auth: ^2.0.0
  flutter_native_admob: ^2.1.0+3
  google_sign_in: ^5.0.4
  flutter_facebook_login: ^3.0.0
  photo_view: ^0.11.1
  flutter_speed_dial: ^3.0.5
  dio: ^4.0.0
  multi_image_picker: ^4.8.1
  progress_dialog: ^1.2.4
  braintree_payment: ^1.2.4
  easy_localization: ^3.0.0
  launch_review: ^3.0.1
  package_info: ^2.0.2
  flutter_icons: ^1.1.0
  stripe_payment: ^1.1.3
  flutter_credit_card: ^2.0.0
  fluttertoast: ^8.0.7
  permission_handler: ^8.1.2
  apple_sign_in: ^0.1.0
  geolocator: ^7.2.0+1
  geocoder: ^0.2.1
  flutter_map: ^0.13.1
  latlong: ^0.6.1
  razorpay_flutter: ^1.2.6
  flutter_widget_from_html: ^0.6.1
  flutter_native_image: ^0.0.6
  group_radio_button: ^1.1.0
  flutter_datetime_picker: ^1.5.1
  flutter_paystack: ^1.0.5+1
  flutter_statusbar_manager: ^2.0.0
  
dev_dependencies:
  flutter_test:
    sdk: flutter

and after run flutter pub get command, I receive below error:

 Because easy_localization >=3.0.0-nullsafety depends on shared_preferences ^2.0.0-nullsafety and dynamic_theme 1.0.1 depends on shared_preferences ^0.5.0, easy_localization >=3.0.0-nullsafety is incompatible with dynamic_theme 1.0.1.
And because no versions of dynamic_theme match >1.0.1 <2.0.0, easy_localization >=3.0.0-nullsafety is incompatible with dynamic_theme ^1.0.1.
So, because fluttermultigrocery depends on both dynamic_theme ^1.0.1 and easy_localization ^3.0.0, version solving failed.
pub get failed (1; So, because fluttermultigrocery depends on both dynamic_theme ^1.0.1 and easy_localization ^3.0.0, version solving failed.)

Upvotes: 0

Views: 622

Answers (1)

Subair K
Subair K

Reputation: 1880

use easy_localization: ^2.3.3 instead of easy_localization: ^3.0.0 in your case

The reason for this error is that you have not migrated to null safety. So, you need either to migrate all packages to null safety or change version of all packages to what before migrated to null safety.

Upvotes: 1

Related Questions