0
votes

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

1
try flutter upgrade command - John Joe
Did that too @JohnJoe - mustafa zaki

1 Answers

1
votes

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