Terminal show error "version solving failed. pub get failed in" in flutter - flutter

When I run flutter pub get then i get this error :
Because every version of flutter_driver from sdk depends on async 2.6.1 and fstore depends on async 2.5.0, flutter_driver from sdk is forbidden.
So, because fstore depends on flutter_driver any from sdk, version solving failed.
pub get failed (1; So, because fstore depends on flutter_driver any from sdk, version solving failed.)
below shoe my all dependencies from pubspec.yml :
dependencies:
flutter:
sdk: flutter
# Base
pedantic: ^1.11.0
intl: 0.17.0
# COMMON
inspireui:
path: ./modules/common_library
rubber:
git:
url: git://github.com/inspireui/rubber
country_pickers:
git:
url: git://github.com/inspireui/country_pickers.git
# FIREBASE PACKAGES
firebase_core: 1.1.0
firebase_analytics: 8.0.2
firebase_auth: 1.1.2
cloud_firestore: 1.0.7
firebase_remote_config: 0.9.0-dev.0
firebase_dynamic_links: 2.0.2
firestore_ui:
git:
url: git://github.com/inspireui/firestore_ui.git
# STATE MANAGEMENT
provider: 5.0.0
get_it: 6.1.1
event_bus: 2.0.0
# SPLASH SCREEN, ONBOARDING
animated_splash: 1.0.0
custom_splash: 0.0.2
flare_splash_screen: 4.0.0
rive: 0.7.3
liquid_swipe: 2.1.0
# UI
animated_text_kit: 4.2.1
animations: 2.0.0
awesome_card: 1.1.5
carousel_pro: 1.0.0
configurable_expansion_tile: 1.0.0
country_code_picker: 2.0.1
flash: 1.5.2
flutter_spinkit: 5.0.0
flutter_staggered_grid_view: 0.4.0
flutter_statusbarcolor: 0.2.3
flutter_swiper: 1.1.6
visibility_detector: 0.2.0
font_awesome_flutter: 9.0.0
file_picker: 3.0.1
page_indicator: 0.4.1
percent_indicator: 3.0.1
pull_to_refresh: 1.6.5
rate_my_app: ^1.1.0+1
cupertino_icons: any
implicitly_animated_reorderable_list: 0.4.0
pin_code_fields: 7.0.0
# WEB TOOLS
html_unescape: 2.0.0
webview_flutter: 2.0.4
flutter_widget_from_html: 0.6.0
flutter_webview_plugin: 0.3.11
responsive_builder: 0.4.1
# MAP
google_maps_flutter: 2.0.3
location: 2.3.5
# STORAGE
localstorage: ^4.0.0+1
# CONNECTIVITY
http: 0.13.2
http_auth: 1.0.0
uni_links: 0.4.0
share: 2.0.1
# AUTHENTICATION
apple_sign_in: 0.1.0
flutter_facebook_login: 3.0.0
google_sign_in: 5.0.2
sms_autofill: 2.0.0
# PUSH NOTIFICATION
firebase_messaging: 9.1.3
notification_permissions: 0.5.0
onesignal_flutter: 2.6.3
# PAYMENTS
stripe_sdk:
git:
url: git://github.com/inspireui/stripe-sdk.git
razorpay_flutter: 1.2.5
# IMAGES
transparent_image: 2.0.0
extended_image: 4.0.1
fwfh_cached_network_image: 0.6.0
image_picker: 0.7.4
multi_image_picker: 4.8.0
flutter_image_compress: 1.0.0
# VIDEOS
video_player: 2.1.1
youtube_player_iframe:
git:
url: git://github.com/inspireui/youtube_player_flutter.git
path: packages/youtube_player_iframe
# ADS
facebook_audience_network: 0.7.1
google_mobile_ads: 0.12.1+1
# TOOLS
auto_size_text: 2.1.0
google_fonts: 2.0.0
random_string: 2.1.0
json_annotation: 4.0.1
timeago: 3.0.2
universal_platform: ^1.0.0-nullsafety
uuid: 3.0.4
validate: 1.7.0
vector_math: any
async: 2.5.0
easy_debounce: 2.0.0
charts_flutter: 0.10.0
devicelocale: ^0.4.1
dev_dependencies:
flutter_driver:
sdk: flutter
flutter_test:
sdk: flutter
version: any
flutter_localizations:
sdk: flutter
test: any
flutter_launcher_icons: 0.8.1
mockito: ^4.1.1 # Testing
# vm_service: 5.5.0
## Enable To run json serializer, run:
## flutter pub run build_runner build --build-filter="lib/models/serializers/*.dart" --delete-conflicting-outputs
## flutter pub run build_runner serve --build-filter="lib/models/serializers/*.dart"
# build_runner: 1.12.2
# json_serializable: 4.1.0
### Override the library to support Flutter 2.0
### Note: This will show the warning but will not impact to the app features 👍
dependency_overrides:
intl: 0.17.0
http: 0.13.2
crypto: 3.0.1
path_provider: 2.0.1
uuid: 3.0.4
http_parser: 4.0.0
pedantic: 1.11.0
flutter_svg: 0.19.3
url_launcher: 6.0.1
cached_network_image: 2.5.1
modal_bottom_sheet: 2.0.0
args: 2.1.0

The issue is with firebase dependencies. Try removing one dependency at a time and distinguish the one which is causing the issue. According to my understanding, the error is most probably with firestore.

After add async 2.6.1 to dependency_overrides: in pubspec.yml it solved

Related

flutter: migrate to null safety an old project

I have this libraries in my project:
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
after_layout: ^1.1.0
alt_sms_autofill: ^1.0.0
another_flushbar: ^1.10.24
avatar_glow: ^2.0.2
barcode_scan2: ^4.1.4
camera: ^0.9.2+2
carousel_slider: ^4.0.0
catcher: ^0.6.8
charts_flutter: ^0.11.0
contacts_service: ^0.6.3
crypto: ^3.0.1
cryptography: ^2.0.2
cupertino_icons: ^1.0.3
device_info: ^2.0.3
dio: ^4.0.1
dotted_border: ^2.0.0+1
encrypt: ^5.0.1
file_picker: ^4.2.0
firebase_messaging: ^10.0.9
flutter:
sdk: flutter
flutter_inappwebview: ^5.3.2
flutter_keyboard_visibility: ^5.1.0
flutter_rating_bar: ^4.0.0
flutter_slidable: ^0.6.0
flutter_svg: ^0.23.0+1
fluttertoast: ^8.0.8
font_awesome_flutter: ^9.2.0
geolocator: ^7.7.1
get_it: ^7.1.3
hive: ^2.0.4
hive_flutter: ^1.1.0
http: ^0.13.3
image_cropper: ^1.4.1
image_gallery_saver: ^1.7.1
image_picker: ^0.8.4+1
installed_apps: ^1.2.0
intl: ^0.17.0
introduction_screen: ^2.1.0
json_annotation: ^4.0.1
local_auth: ^1.1.7
logger: ^1.1.0
mask_text_input_formatter: ^2.0.0
otp: ^3.0.1
overlay_support: ^1.2.1
package_info_plus: ^1.3.0
page_view_indicators: ^2.0.0
path_provider: ^2.0.4
permission_handler: ^8.1.6
persian: ^1.1.1
persian_datetime_picker:
path: packages/persian_datetime_picker
persian_number_utility: ^1.1.0
provider: ^6.0.1
quick_actions: ^0.6.0+6
retrofit: ^2.1.0
rxdart: ^0.27.2
screenshot: ^1.2.3
shared_preferences: ^2.0.7
sqflite: ^2.0.0+4
timezone: ^0.8.0
universal_html: ^2.0.8
url_launcher: ^6.0.10
url_strategy: ^0.2.0
uuid: ^3.0.5
video_player: ^2.2.3
visibility_detector: ^0.2.2
wc_flutter_share: ^0.4.0
webview_flutter: ^2.0.13
dev_dependencies:
build_runner: ^2.1.2
flutter_localizations:
sdk: flutter
flutter_test:
sdk: flutter
hive_generator: ^1.1.1
http_mock_adapter: ^0.3.2
json_serializable: ^4.1.4
mockito: ^5.0.15
retrofit_generator: ^2.0.1
I run this command and It's result:
$ flutter pub upgrade --null-safety
Resolving dependencies...
_fe_analyzer_shared 22.0.0 (30.0.0 available)
after_layout 1.1.0
alt_sms_autofill 1.0.0
analyzer 1.7.1 (2.7.0 available)
another_flushbar 1.10.24
args 2.3.0
asn1lib 1.0.2
async 2.5.0 (2.8.2 available)
avatar_glow 2.0.2
barcode_scan2 4.1.4
base32 2.1.1
boolean_selector 2.1.0
build 2.1.0 (2.1.1 available)
build_config 1.0.0
build_daemon 3.0.0 (3.0.1 available)
build_resolvers 2.0.4
build_runner 2.1.2 (2.1.4 available)
build_runner_core 7.1.0 (7.2.2 available)
built_collection 5.1.1
built_value 8.1.3
camera 0.9.2+2 (0.9.4+3 available)
camera_platform_interface 2.1.1
carousel_slider 4.0.0
catcher 0.6.8
characters 1.1.0 (1.2.0 available)
charcode 1.2.0 (1.3.1 available)
charts_common 0.11.0 (0.12.0 available)
charts_flutter 0.11.0
checked_yaml 2.0.1
cli_util 0.3.5
clock 1.1.0
code_builder 4.1.0
collection 1.15.0
contacts_service 0.6.3
convert 3.0.1
cross_file 0.3.2
crypto 3.0.1
cryptography 2.0.2
csslib 0.17.1
cupertino_icons 1.0.3
dart_style 2.1.1 (2.2.0 available)
device_info 2.0.3
device_info_platform_interface 2.0.1
device_info_plus 2.2.0 (3.1.0 available)
device_info_plus_linux 2.1.0
device_info_plus_macos 2.2.0
device_info_plus_platform_interface 2.2.0
device_info_plus_web 2.1.0
device_info_plus_windows 2.1.0
dio 4.0.1
dio_http 5.0.4
dots_indicator 2.0.0
dotted_border 2.0.0+1
encrypt 5.0.1
fake_async 1.2.0
ffi 1.1.2
file 6.1.2
file_picker 4.2.0
firebase_core 1.8.0
firebase_core_platform_interface 4.0.1
firebase_core_web 1.1.0
firebase_messaging 10.0.9
firebase_messaging_platform_interface 3.0.7
firebase_messaging_web 2.0.7
fixnum 1.0.0
flutter 0.0.0 from sdk flutter
flutter_inappwebview 5.3.2
flutter_keyboard_visibility 5.1.0
flutter_keyboard_visibility_platform_interface 2.0.0
flutter_keyboard_visibility_web 2.0.0
flutter_localizations 0.0.0 from sdk flutter
flutter_mailer 2.0.0
flutter_plugin_android_lifecycle 2.0.4
flutter_rating_bar 4.0.0
flutter_slidable 0.6.0
flutter_svg 0.23.0+1
flutter_test 0.0.0 from sdk flutter
flutter_web_plugins 0.0.0 from sdk flutter
fluttertoast 8.0.8
font_awesome_flutter 9.2.0
frontend_server_client 2.1.2
geolocator 7.7.1
geolocator_android 2.1.0
geolocator_apple 1.2.2
geolocator_platform_interface 2.3.6
geolocator_web 2.0.6
get_it 7.1.3 (7.2.0 available)
glob 2.0.1 (2.0.2 available)
graphs 2.1.0
hive 2.0.4
hive_flutter 1.1.0
hive_generator 1.1.1
html 0.15.0
http 0.13.3 (0.13.4 available)
http_mock_adapter 0.3.2
http_multi_server 3.0.1
http_parser 4.0.0
image_cropper 1.4.1
image_gallery_saver 1.7.1
image_picker 0.8.4+1 (0.8.4+4 available)
image_picker_for_web 2.1.4
image_picker_platform_interface 2.4.1
installed_apps 1.2.0
intl 0.17.0
introduction_screen 2.1.0
io 1.0.3
js 0.6.3
json_annotation 4.0.1 (4.3.0 available)
json_serializable 4.1.4 (6.0.1 available)
local_auth 1.1.7 (1.1.8 available)
logger 1.1.0
logging 1.0.2
mailer 5.0.2
mask_text_input_formatter 2.0.0
matcher 0.12.10 (0.12.11 available)
meta 1.3.0 (1.7.0 available)
mime 1.0.1
mockito 5.0.15 (5.0.16 available)
nested 1.0.0
otp 3.0.1
overlay_support 1.2.1
package_config 2.0.2
package_info_plus 1.3.0
package_info_plus_linux 1.0.3
package_info_plus_macos 1.3.0
package_info_plus_platform_interface 1.0.2
package_info_plus_web 1.0.4
package_info_plus_windows 1.0.4
page_view_indicators 2.0.0
path 1.8.0
path_drawing 0.5.1+1
path_parsing 0.2.1
path_provider 2.0.4 (2.0.6 available)
path_provider_linux 2.1.0
path_provider_macos 2.0.2
path_provider_platform_interface 2.0.1
path_provider_windows 2.0.3
pedantic 1.11.1 (discontinued replaced by lints)
permission_handler 8.1.6 (8.2.5 available)
permission_handler_platform_interface 3.6.1 (3.7.0 available)
persian 1.1.1
persian_datetime_picker 2.0.0 from path packages/persian_datetime_picker
persian_number_utility 1.1.0
petitparser 4.1.0 (4.4.0 available)
platform 3.0.2
plugin_platform_interface 2.0.2
pointycastle 3.3.5
pool 1.5.0
process 4.2.3 (4.2.4 available)
protobuf 2.0.0
provider 6.0.1
pub_semver 2.1.0
pubspec_parse 1.0.0 (1.1.0 available)
quick_actions 0.6.0+6 (0.6.0+7 available)
quick_actions_platform_interface 1.0.0
quiver 3.0.1+1
retrofit 2.1.0
retrofit_generator 2.0.1 (2.1.0+1 available)
rxdart 0.27.2
screenshot 1.2.3
sentry 5.1.0 (6.0.1 available)
shamsi_date 0.16.0
shared_preferences 2.0.7 (2.0.8 available)
shared_preferences_linux 2.0.2
shared_preferences_macos 2.0.2
shared_preferences_platform_interface 2.0.0
shared_preferences_web 2.0.2
shared_preferences_windows 2.0.2
shelf 1.2.0
shelf_web_socket 1.0.1
sky_engine 0.0.99 from sdk flutter
source_gen 1.0.3 (1.1.1 available)
source_helper 1.3.0
source_span 1.8.0 (1.8.1 available)
sqflite 2.0.0+4
sqflite_common 2.0.1+1
stack_trace 1.10.0
stream_channel 2.1.0
stream_transform 2.0.0
string_scanner 1.1.0
synchronized 3.0.0
term_glyph 1.2.0
test_api 0.2.19 (0.4.7 available)
timezone 0.8.0
timing 1.0.0
tuple 2.0.0
typed_data 1.3.0
universal_html 2.0.8
universal_io 2.0.4
url_launcher 6.0.10 (6.0.12 available)
url_launcher_linux 2.0.2
url_launcher_macos 2.0.2
url_launcher_platform_interface 2.0.4
url_launcher_web 2.0.4
url_launcher_windows 2.0.2
url_strategy 0.2.0
uuid 3.0.5
vector_math 2.1.0 (2.1.1 available)
video_player 2.2.3 (2.2.6 available)
video_player_platform_interface 4.2.0
video_player_web 2.0.4
visibility_detector 0.2.2
watcher 1.0.0 (1.0.1 available)
wc_flutter_share 0.4.0
web_socket_channel 2.1.0
webview_flutter 2.0.13 (2.1.2 available)
win32 2.0.5 (2.2.10 available)
xdg_directories 0.2.0
xml 5.1.2 (5.3.1 available)
yaml 3.1.0
No dependencies changed.
43 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
No changes to pubspec.yaml!
Why I cant update my libs, I want to migrate my old project to null safety?
First backup your project for safety.
Try this,
flutter clean
Now delete pubspec.lock file.
Now delete all the versions from pubspec.yaml.
Leaving version number empty, let flutter decide which to use.
Upgrade SDK version,
environment:
sdk: ">=2.14.0 <3.0.0"
Now run,
flutter pub get

Facing the issue in pubspec.yaml

When i integrate the library new_version: ^0.2.0 in the project after pub get i get this error -
Because new_version >=0.0.7 depends on package_info_plus ^1.0.0 which depends on package_info_plus_platform_interface ^1.0.0, new_version >=0.0.7 requires package_info_plus_platform_interface ^1.0.0.
And because package_info_plus_platform_interface >=1.0.0-nullsafety.1 depends on plugin_platform_interface ^2.0.0 and file_picker 2.1.6 depends on plugin_platform_interface ^1.0.1, new_version >=0.0.7 is incompatible with file_picker 2.1.6.
So, because fstore depends on both file_picker 2.1.6 and new_version ^0.2.0, version solving failed.
pub get failed (1; So, because fstore depends on both file_picker 2.1.6 and new_version ^0.2.0, version solving failed.)
I don't understand what does it mean is this flutter version issue or sdk issue???
Here is the pubspec.yaml file where all the library has been integrate for the project, if i remove the new_version library project will work perfectly fine.
name: fstore
publish_to: "none"
description: Mobile commerce app by Flutter
# 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: 2.0.0+3001
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# COMMON
inspireui:
path: ./modules/common_library
pedantic: 1.9.2
rubber:
git:
url: git://github.com/inspireui/rubber
country_pickers:
git:
url: git://github.com/inspireui/country_pickers.git
# FIREBASE PACKAGES
cloud_firestore: 0.14.4
firebase_analytics: 6.3.0
firebase_auth: 0.18.4+1
firebase_core: 0.5.3
firebase_database: 4.4.0
firestore_ui: 1.12.0
firebase_remote_config: ^0.4.3
# STATE MANAGEMENT
provider: 4.3.3
# UI
animated_splash: 1.0.0
animated_text_kit: 3.1.2
animations: 1.1.2
awesome_card: 1.1.0
carousel_pro: 1.0.0
configurable_expansion_tile: 1.0.0
country_code_picker: 1.7.0
custom_splash: 0.0.2
flare_splash_screen: 3.0.1
rive: 0.6.8
flash: 1.3.2
flutter_spinkit: 4.1.2+1
flutter_staggered_grid_view: 0.3.4
flutter_statusbarcolor: 0.2.3
flutter_swiper: 1.1.6
visibility_detector: 0.1.5
font_awesome_flutter: 8.11.0
image_picker: 0.6.7+15
file_picker: 2.1.6
multi_image_picker: 4.7.15
intro_slider: 2.3.4
liquid_swipe: 1.5.0
page_indicator: 0.3.0
percent_indicator: 2.1.9+1
pin_code_fields: 6.1.0
pull_to_refresh: 1.6.4
rate_my_app: 0.7.2
sticky_headers: 0.1.8+1
zoom_widget: 0.1.3
cupertino_icons: any
# WEB TOOLS
video_player: 2.0.0
html_unescape: 1.0.2
webview_flutter: 2.0.1
flutter_widget_from_html: 0.6.0-rc.2021030401
flutter_webview_plugin: 0.3.11
responsive_builder: 0.3.0
# MAP
google_maps_flutter: 1.2.0
location: 2.3.5 # use this version to compatible with fluxbuilder
# STORAGE
localstorage: 3.0.6+9 # depend on google font
shared_preferences: 2.0.3
# CONNECTIVITY
connectivity: 2.0.2
http: 0.13.0
http_auth: 0.3.1
uni_links: 0.4.0
firebase_dynamic_links: 0.6.3
# AUTHENTICATION
apple_sign_in: 0.1.0
flutter_facebook_login: 3.0.0
google_sign_in: 4.5.6
# PUSH NOTIFICATION
firebase_messaging: 7.0.3
notification_permissions: 0.4.8
onesignal_flutter: 2.6.2
# PAYMENTS
stripe_sdk:
git:
url: git://github.com/inspireui/stripe-sdk.git
razorpay_flutter: 1.2.3
# IMAGES
extended_image:
git:
url: git://github.com/inspireui/extended_image.git
transparent_image: 1.0.0
# ADS
facebook_audience_network: 0.7.1
firebase_admob: 0.10.3
# IN APP
new_version: ^0.2.0
# TOOLS
auto_size_text: 2.1.0
event_bus: 1.1.1
google_fonts: 2.0.0
random_string: 2.1.0
share: 0.6.5+4
sms_autofill: 1.3.1
json_annotation: 3.1.1
timeago: 3.0.1
universal_platform: ^0.1.3
uuid: 3.0.1
validate: 1.7.0
vector_math: any
async: 2.5.0
easy_debounce: 1.0.2
jwt_decoder: 1.0.4
charts_flutter: 0.9.0
flutter_image_compress: ^0.7.0
encrypt: 4.1.0
adaptive_breakpoints: 0.0.3
intl: 0.17.0
# For Shopify GraphQL
graphql: 3.1.0
flutter_localizations:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
version: any
flutter_launcher_icons: 0.8.1
mockito: ^4.1.1 # Testing
#To run json serializer, run:
# flutter pub run build_runner build --build-filter="lib/models/serializers/*.dart" --delete-conflicting-outputs
# flutter pub run build_runner serve --build-filter="lib/models/serializers/*.dart"
build_runner: 1.11.1
json_serializable: 3.5.1
### Override the library to support Flutter 2.0
### Note: This will show the warning but will not impact to the app features 👍
dependency_overrides:
intl: 0.17.0
http: 0.13.0
crypto: 3.0.0
path_provider: 2.0.1
uuid: 3.0.1
http_parser: 4.0.0
shared_preferences: 2.0.3
pedantic: 1.9.2
flutter_svg: 0.19.3
extended_image:
git:
url: git://github.com/inspireui/extended_image.git
url_launcher: 6.0.1
cached_network_image: 2.5.0
fwfh_cached_network_image: ^0.6.0-rc.2021030401
modal_bottom_sheet: 2.0.0-nullsafety.1
# Run this script to generate the app icon: flutter pub run flutter_launcher_icons:main
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/app_icon.png"
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
uses-material-design: true
assets:
- lib/config/
- lib/config/mocks/
- lib/config/states/
- lib/config/stories/
- assets/icons/categories/
- assets/icons/tabs/
- assets/icons/payment/
- assets/images/
- assets/images/country/
- assets/images/favicon/
- assets/html/
- assets/google_fonts/
fonts:
- family: Feather
fonts:
- asset: assets/fonts/Feather.ttf
- family: SF Pro Display
fonts:
- asset: assets/fonts/SF-Pro-Display-Semibold.otf
weight: 700
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.io/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:
#
# For details regarding fonts from package dependencies,
# see https://flutter.io/custom-fonts/#from-packages
flutter_intl:
enabled: true
You can do sth like this to force using a specific version
dependency_overrides:
package_info_plus_platform_interface: ^1.0.0
or
dependency_overrides:
plugin_platform_interface: ^2.0.0
Just write new_version: any, and get the pub. After that, get the suitable version from pubspec.lock. You will get the solusion.

Because Cruise depends on intl >=0.17.0-nullsafety which requires SDK version >=2.11.0-180.0.dev <3.0.0, version solving failed

Today when I compile my project, it shows this error:
The current Dart SDK version is 2.10.5.
Because Cruise depends on intl >=0.17.0-nullsafety which requires SDK version >=2.11.0-180.0.dev <3.0.0, version solving failed.
pub get failed (1; Because Cruise depends on intl >=0.17.0-nullsafety which requires SDK version >=2.11.0-180.0.dev <3.0.0, version solving failed.)
Process finished with exit code 1
this is my intl dependencies:
intl: 0.17.0
I do not add the intl >=0.17.0-nullsafety dependencies. why have this error and what should I do to fix it? this is the full pubspec.yaml:
name: Cruise
description: A RSS article read Flutter application.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: 0.17.0
meta: ^1.1.8
flutter_svg: 0.19.0
logger: 0.9.4
scoped_model: ^1.1.0
shrine_images: ^1.1.2
flare_dart: 2.3.4
flare_flutter: ^2.0.2
vector_math: ^2.0.8
collection: ^1.14.0
package_info: ^0.4.0
fluttertoast: 7.1.6
#google_fonts: 1.0.0
flutter_staggered_grid_view: ^0.3.0
adaptive_breakpoints: ^0.0.2
cupertino_icons: 1.0.0
http: ^0.12.0+2
flutter_icons: ^1.0.0
timeago: 2.0.26
animations: 1.1.2
flutter_hooks: ^0.12.0
share: ^0.6.4+3
shimmer: 1.1.1
crypto: 2.1.5
url_launcher: 5.5.0
uni_links: 0.4.0
flutter_html: 1.2.0
shared_preferences: ^0.5.8
state_notifier: ^0.5.0
flutter_secure_storage: 3.3.3
flutter_slidable: "^0.5.5"
hive: ^1.4.1+1
#fluwx: ^2.4.1
pull_to_refresh: 1.6.3
intl_phone_number_input: ^0.5.0
dio: 3.0.10
fish_redux: 0.3.4
hive_flutter: 0.3.1
dev_dependencies:
flutter_test:
sdk: flutter
test:
path:
args:
grinder: ^0.8.0
pedantic: ^1.9.0
string_scanner: ^1.0.5
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
generate: true
If you have updated flutter to the latest version, then in your pubspec.yaml you should have this line:
environment:
sdk: ">=2.12.0 <3.0.0"

Because every version of flutter_driver from sdk depends on crypto 3.0.0 and Cruise depends on crypto 2.1.3, flutter_driver from sdk is forbidden

When I compile my project, it shows this error:
Running "flutter pub get" in cruise-open...
Because every version of flutter_driver from sdk depends on crypto 3.0.0 and Cruise depends on crypto 2.1.3, flutter_driver from sdk is forbidden.
So, because Cruise depends on flutter_driver any from sdk, version solving failed.
pub get failed (1; So, because Cruise depends on flutter_driver any from sdk, version solving failed.)
I have tried each version of crypto but still not fix my problem, what should I do to solve it? This is my pubspec.yaml:
name: Cruise
description: A RSS article read Flutter application.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: 0.16.1
meta: ^1.1.8
flutter_svg: 0.19.0
logger: 0.9.4
marquee: ^1.7.0
scoped_model: ^1.1.0
shrine_images: ^1.1.2
flare_dart: 2.3.4
flare_flutter: ^2.0.2
vector_math: ^2.0.8
collection: ^1.14.0
package_info: ^0.4.0
fluttertoast: 7.1.6
google_fonts: 1.0.0
flutter_staggered_grid_view: ^0.3.0
adaptive_breakpoints: ^0.0.2
cupertino_icons: 1.0.0
http: ^0.12.0+2
flutter_icons: ^1.0.0
timeago: 2.0.26
animations: 1.1.2
flutter_hooks: ^0.12.0
share: ^0.6.4+3
shimmer: 1.1.1
crypto: 2.1.3
url_launcher: 5.5.0
uni_links: 0.4.0
flutter_html: 1.2.0
shared_preferences: ^0.5.8
state_notifier: ^0.5.0
flutter_secure_storage: 3.3.3
flutter_slidable: "^0.5.5"
hive: ^1.4.1+1
#fluwx: ^2.4.1
pull_to_refresh: 1.6.3
intl_phone_number_input: ^0.5.0
dio: 3.0.10
fish_redux: 0.3.4
hive_flutter:
git:
url: https://github.com/hivedb/hive.git
path: hive_flutter
dev_dependencies:
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
test:
path:
args:
grinder: ^0.8.0
pedantic: ^1.9.0
string_scanner: ^1.0.5
# 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
generate: true
The problem lies here crypto: 2.1.3. You need to update it to the latest version i. e. crypto: ^3.0.0.
This should solve your issue.
What happens is that when you use so many packages, some of those packages use some other packages. It may so happen that two or more packages use the same package.
In your case, the package flutter_driver uses the package crypto. And you yourself are using the package crypto but a different version of it. So, it creates an error because you cannot have two different versions of the same package.

Flutter image version issue

I have just upgraded my flutter version and now I am facing the following issue when I get the packages in pubsec.yml file:
Because every version of flutter_test from sdk depends on image 2.1.4 and Instant_Feedback depends on image ^2.1.9, flutter_test from sdk is forbidden.
So, because Instant_Feedback depends on flutter_test any from sdk,
version solving failed. pub get failed (1; So, because
Instant_Feedback depends on flutter_test any from sdk, version solving
failed.)
My pubsec.yml file
dependencies:
flutter:
sdk: flutter
http: ^0.12.0+2
shared_preferences: ^0.5.4+8
firebase_messaging: ^6.0.3
flutter_crashlytics: ^1.0.0
firebase_core: ^0.4.2+1
cupertino_icons: ^0.1.3
device_calendar: ^1.0.0+2
cloud_firestore: ^0.12.11
auto_size_text: ^2.1.0
flutter_expandable_menu: ^0.0.1
webview_flutter: ^0.3.17
flutter_spinkit: ^4.1.1+1
get_it: 2.1.0
bloc: ^0.15.0
flutter_bloc: 0.21.0
equatable: 0.5.1
rflutter_alert: ^1.0.3
expandable: ^3.0.1
connectivity: ^0.4.6
firebase_auth: ^0.15.1
flutter_email_sender: ^2.2.1
mockito: 4.1.1
flutter_secure_storage: ^3.3.1+1
image_picker: ^0.6.2+2
async: any
image: ^2.1.10
image_crop: ^0.3.1
flutter_cache_manager: ^1.1.3
circular_profile_avatar: ^1.0.3
package_info: ^0.4.0+12
flutter_local_notifications: ^0.8.4+3
flutter_webview_plugin: ^0.3.10
url_launcher: ^5.2.7
flutter_localizations:
sdk: flutter
flutter_cupertino_localizations: ^1.0.1
dev_dependencies:
flutter_driver:
sdk: flutter
test: any
ozzie: 2.0.1
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- lib/app/assets/images/
- lib/app/assets/flags/
- lang/en.json
- lang/de.json
Because every version of flutter_test from sdk depends on image 2.1.4 and Instant_Feedback depends on image ^2.1.9, flutter_test from sdk is forbidden.
I faced the same issue. Couldn't find the specific reason for the flutter_test depending on a specific version of this image library. Maybe it's an issue from the flutter side. So here are some workaround solutions:
comment out the flutter_test dev_dependency.
dev_dependencies:
# flutter_test:
# sdk: flutter
set the required version.
Instead of 2.1.12, I set the Image package version to 2.1.4 (as requested in the error message)
image: ^2.1.4
If more than one packages versions are noncompatible to each other, and you don't know their exact compatible version, you can find it by setting both the conflicting dependencies to any, e.g.
flutter_crashlytics: any
firebase_core: any
This will automatically figure out the compatible package version. Check these new compatible versions in pubspec.lock file, which will be auto-generated by running flutter package get.
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
packages:
flutter_crashlytics:
...
version: "1.0.0"
firebase_core:
...
version: "0.4.2+1"
Replace any with those correct versions.
flutter_crashlytics: 1.0.0
firebase_core: 0.4.2+1
Note: You should never leave your versions as any