I create a project a little while ago, in Flutter. This week I went back to it and updated the dependencies. Suddenly I'm getting this new error:
Because firebase_core ^0.5.2+1 depends on firebase_core_platform_interface ^2.1.0 and firebase_storage >=7.0.0 <8.0.0-1.0.nullsafety.0 depends on firebase_core_platform_interface ^3.0.1, firebase_core ^0.5.2+1 is incompatible with firebase_storage >=7.0.0 <8.0.0-1.0.nullsafety.0.
So, because [project_name] depends on both firebase_storage ^7.0.0 and firebase_core ^0.5.3, version solving failed.
pub get failed (1; So, because [project_name] depends on both firebase_storage ^7.0.0 and firebase_core ^0.5.3, version solving failed.)
I've searched online and can see that it's a recurring problem that loads of people have faced without any solutions. I'm just hoping someone here has a fix specific to mine. Any help is appreciated. Below is my dependencies section in the pubspec.yaml file.
dependencies:
flutter:
sdk: flutter
getflutter: ^1.0.10
#firebase_auth: ^0.20.1
#cloud_firestore: ^0.16.0
image_picker: ^0.6.3+4
#firebase_storage: ^7.0.0
provider: ^4.0.4
gender_selector: ^1.0.6
gender_selection: "^0.0.8"
flutter_spinkit: "^4.1.2"
place_picker: ^0.9.11
flutter_country_picker: ^0.1.6
multi_image_picker: ^4.6.7
firebase_auth: "^0.18.4+1"
firebase_crashlytics: "^0.4.0"
cloud_firestore: "^0.16.0"
cloud_functions: "^0.9.0"
firebase_storage: "^7.0.0"
firebase_core: ^0.5.3
firebase_database: ^7.1.1
Update your firebase dependencies to the latest version:
dependencies:
flutter:
sdk: flutter
firebase_auth: ^3.3.3
firebase_crashlytics: ^2.4.3
cloud_firestore: ^3.1.4
cloud_functions: ^3.2.3
firebase_storage: ^10.2.3
firebase_core: ^1.10.5
firebase_database: ^9.0.3
I'm not sure what I did to resolve this problem. After changing loads of things and changing the dart SDK to the latest one, it seems to work fine.
Calling dart pub outdated --mode=null-safety and then dart pub upgrade --null-safety to resolve these issues.
Documentation: https://dart.dev/null-safety/migration-guideues
Related
So I have these dependencies which work fine together:
dependencies:
flutter:
sdk: flutter
auto_size_text: ^2.1.0
#Firebase
# cloud_firestore: ^1.0.0
firebase_auth: ^0.18.0+1
google_sign_in: ^4.0.4
provider: ^4.3.2+1
flutter_dialogflow_v2: ^0.3.2
bubble: ^1.2.1
intl: ^0.16.1
material_design_icons_flutter: ^4.0.5955
flutter_spinkit: "^4.1.2"
auth_buttons: ^1.0.1+3
Now if I add cloud_firestore, no matter what version, I get this error:
Because firebase_auth ^0.18.3+1 depends on firebase_core_platform_interface ^2.1.0 and firebase_auth >=0.18.0 <=0.18.3 depends on firebase_core_platform_interface >=2.0.0 <2.1.0, firebase_auth ^0.18.0 requires firebase_core_platform_interface >=2.0.0 <2.1.0 or ^2.1.0.
And because cloud_firestore >=2.1.0 depends on firebase_core_platform_interface ^4.0.1, firebase_auth ^0.18.0 is incompatible with cloud_firestore >=2.1.0.
It seems that the firebase_core_platform_interface is the problem here because two dependencies depend on different versions.
Is there a way of checking the best version mix for this dependency setup?
I can't figure it out.
Set them all to any, then run flutter pub get.
Now you can look in the pubspec.lock file and see what versions you got and put them in pubspec.yaml.
I want to add firebase_messaging package to my flutter app, but when I install it, an error appeared which is:
Because firebase_messaging >=7.0.3 <8.0.0-dev.7 depends on firebase_core ^0.5.0+1 and elderly_app depends on firebase_core ^0.7.0, firebase_messaging >=7.0.3 <8.0.0-dev.7 is forbidden.
So, because elderly_app depends on firebase_messaging 7.0.3, version solving failed.
pub get failed (1; So, because elderly_app depends on firebase_messaging 7.0.3, version solving failed.)
I have tried to install two versions of firebase_messaging , they are :
firebase_messaging: ^9.0.0 and firebase_messaging: 7.0.3
and also the same error appeard.
These are my dependencies in pubspec.yaml :
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
ff_navigation_bar: ^0.1.5
calendar_timeline: ^0.7.0
date_time_picker: "^1.1.1"
firebase_core: ^0.7.0
firebase_auth: ^0.20.0+1
cloud_firestore: ^0.16.0
modal_progress_hud: ^0.1.3
datetime_picker_formfield: ^1.0.0
adhan: ^1.1.14
image_picker: ^0.6.7+22
syncfusion_flutter_calendar: ^18.4.42
geolocator: ^6.2.1
fluttertoast: ^7.1.6
geocoder: ^0.2.1
some_calendar: ^1.2.6
flutter_calendar_week:
git:
url: https://github.com/mduccc/flutter_calendar_week
ref: 0.1.0
bubble: ^1.1.9+1
firebase_storage: ^7.0.0
charts_flutter: ^0.9.0
firebase_messaging: 7.0.3
try removing the version number and use it like this:
firebase_messaging:
You must update the core version, also keep all firebase products up to dated,
use the following latest release or you will face a lot of problems:
firebase_messaging: ^9.0.0
firebase_core: ^1.0.1
firebase_auth: ^1.0.1
cloud_firestore: ^1.0.1
you can get to know the updates on every package you use by running 'flutter pub outdated'
In pubspec.yaml, if I use the following dependencies of firebase_core and firebase_messaging :
dependencies:
firebase_core: ^0.7.0
firebase_messaging: ^7.0.3
I get the following error message :
Because firebase_messaging >=7.0.3 <8.0.0-dev.7 depends on firebase_core ^0.5.0+1 and yourApp depends on firebase_core ^0.7.0, firebase_messaging >=7.0.3 <8.0.0-dev.7 is forbidden.
So, because youApp depends on firebase_messaging ^7.0.3, version solving failed.
pub get failed (1; So, because chat_app depends on firebase_messaging ^7.0.3, version solving failed.)
Update your pubspec.yaml according to the migration guide to FlutterFire :
https://firebase.flutter.dev/docs/migration/
Caution: At the time of writting, FlutterFire Migration Guide does not compiled with firebase_core 0.7.0 and firebase_messaging 7.0.0, that's why I suggested to use firebase_messaging 8.0.0-dev :
dependencies:
firebase_core: ^0.7.0
firebase_messaging: ^8.0.0-dev.14
Just try with clean and remove pubspec.lock (kindly take backup)
flutter clean
pub cache repair // optional
and this then update your pubspec.yaml, this works for me (Y)
dependencies:
firebase_core: ^0.7.0
firebase_messaging: ^8.0.0-dev.14
Just do it
dependencies:
firebase_core: ^0.7.0
firebase_messaging:
It will use the latest version of firebase_messaging
I had changed the version of cloud_firestore from 0.16.0 to 0.15.0 since it was not working. However, it did not resolve my issue - and now when I changed the version back to 0.16.0 it is giving me the same error with 0.15.0 version, even though I changed it to 0.16.0.
dependencies:
flutter:
sdk: flutter
provider: ^4.3.2+2
dotted_line: ^2.0.2
intl: ^0.16.1
uuid: ^2.2.2
cloud_firestore: ^0.16.0
firebase_auth: ^0.20.0+1
smooth_star_rating: ^1.0.4
google_maps: ^4.0.0
firebase_core: ^0.7.0
rxdart: ^0.24.1
This is the error I am getting when I save my pubspec.yaml file:
Because my_app depends on cloud_firestore ^0.15.0 which depends on
firebase_core ^0.6.0, firebase_core ^0.6.0 is required. So, because
my_app depends on firebase_core ^0.7.0, version solving failed. pub
get failed (1; So, because my_app depends on firebase_core ^0.7.0,
version solving failed.) exit code 1
Firebase packages depend on every other package's version. If you want to use the specific version then look for other firebase dependencies with the compatible version.
According to the error that you get, the cloud_firestore ^0.15.0 required the firebase_core ^0.6.0.
If you are getting the same error after reverting back to the cloud_firestore ^0.16.0 then run the $ flutter clean command and then rebuild the application. This will remove the previously cached data and freshly build the app. Be sure you had run the $ flutter pub get command after reverting back to cloud_firestore ^0.16.0
Because firebase_storage >=2.0.0 depends on firebase_core ^0.3.0 and firebase_auth 0.6.6 depends on firebase_core ^0.2.5+1, firebase_storage >=2.0.0 is incompatible with firebase_auth 0.6.6.
And because no versions of firebase_auth match >0.6.6 <0.7.0, firebase_storage >=2.0.0 is incompatible with firebase_auth ^0.6.6.
So, because store_manager_erp_next depends on both firebase_auth ^0.6.6 and firebase_storage ^2.1.0+1, version solving failed.
I am new in flutter, please help me to solve this issue
banner: ^0.1.3
cloud_firestore: ^0.8.2
http: ^0.12.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
#sqflite: any
sqflite: ^0.13.0+1
folding_cell: "^0.1.0"
flutter_rating: ^0.0.2
firebase_auth: ^0.6.6
firebase_database: ^1.0.5
firebase_storage: ^2.1.0+1
fluttertoast: ^2.1.5
progress_hud: ^1.1.0
auto_size_text: ^0.3.0
mongo_dart: ^0.3.4
google_sign_in: ^3.0.4
material_search: ^0.2.8
flutter_secure_storage: ^3.1.2
modal_progress_hud: ^0.1.2
flutter_typeahead: ^0.4.1
# flutter_facebook_login: ^1.1.1
flutter_firebase_ui: ^0.0.13
json_serializable: ^2.0.1
flutter_spinkit: "^3.1.0"
shared_preferences: ^0.4.3
flutter_html: ^0.8.2
#pinch_zoom_image: "^0.2.5"
#photo_view: ^0.2.0
splashscreen: ^1.1.0
#shared_preferences: ^0.4.3
badges: ^0.0.6
Change
firebase_auth: ^0.6.6
to
firebase_auth: ^0.8.0
You might also need to check other dependencies if the constraints are outdated.
You can also use the workaround mentioned in https://github.com/flutter/flutter/issues/12627#issuecomment-400037580
export FLUTTER_ROOT="/Users/something/flutter"
pub upgrade
to get information for what dependencies updates are available.
just add this line of code in your pubspec
dependency_overrides:
firebase_core: 0.3.0
this will override the dependency, and you can use whatever version you want.
you might need to change it the version of the package.
my code example:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
file_picker: ^3.0.0
hive: ^2.0.0
hive_flutter: ^1.0.0
dependency_overrides:
path_provider: 2.0.1
You need to migrate your project to AndroidX . Please see the following documentation for detailed steps on it...
Migrate to Android X
Or else, just downgrade the firebase_auth version to the old version that works fine without androidX migration
consult this link https://github.com/FirebaseExtended/flutterfire/issues/4650 and replace the version of your project with the corresponding version
Try run pub get by omitting the version name of the package which is causing you the issue like this
firebase_storage:
This will get you out the issue.
you can downgrade your google sign in version to stable one like
google_sign_in: ^4.5.9
to know the most stable one go to
https://pub.dev/packages/google_sign_in/versions
and choose latest one before beta version
pubspec.yaml file
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
get: ^4.2.4
google_sign_in: ^4.5.9
firebase_core: "0.7.0"
firebase_auth: "^0.20.1"