Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
499 views
in Technique[技术] by (71.8m points)

firebase - How can I resolve the cloud_firestore dependancy error?

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

question from:https://stackoverflow.com/questions/65948793/how-can-i-resolve-the-cloud-firestore-dependancy-error

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...