flutterfirebasegoogle-cloud-firestoreflutter-windows

Problems when updating the cloud_firestore package to version 4.13.0 (to Windows) on Flutter


I really need to run firestore o Windows app. For that, I need at least cloud_firestore v4.13.0 I tried a lot of things... but I am getting this problems:

Showing outdated packages.
[*] indicates versions that are not the latest available.
Package Name        Current  Upgradable  Resolvable  Latest
direct dependencies: 
cloud_firestore     *4.9.3   *4.9.3      *4.9.3      4.14.0 
firebase_analytics  *10.5.1  *10.5.1     *10.5.1     10.8.0
firebase_auth       *4.10.1  *4.10.1     *4.10.1     4.16.0 
firebase_core       *2.17.0  *2.17.0     *2.17.0     2.24.2 
intl                *0.18.1  *0.18.1     *0.18.1     0.19.0
dev_dependencies: all up-to-date. 
You are already using the newest resolvable versions listed in the 'Resolvable' column. Newer versions, listed in 'Latest', may not be mutually compatible.

If I try to use a specific version, I got this error:

Resolving dependencies...
Because no versions of firebase_core_desktop match >1.0.2 and firebase_core_desktop <0.1.1-dev.1 depends on firebase_core_platform_interface 4.0.1, firebase_core_desktop <0.1.1-dev.1 or >1.0.2 requires firebase_core_platform_interface 4.0.1. And because firebase_core_desktop >=0.1.1-dev.1 <1.0.1 depends on firebase_core_platform_interface 4.1.0 and firebase_core_desktop >=1.0.1 <1.0.2 depends on firebase_core_platform_interface 4.4.3, firebase_core_desktop <1.0.2-∞ or >1.0.2 requires firebase_core_platform_interface 4.0.1. And because firebase_core_desktop 1.0.2 depends on firebase_core_platform_interface 4.5.0 and cloud_firestore >=4.10.0 depends on firebase_core_platform_interface 5.0.0, firebase_core_desktop is incompatible with cloud_firestore >=4.10.0. So, because calc_renda_fixa depends on both cloud_firestore 4.13.0 and firebase_core_desktop any, version solving failed.
You can try the following suggestion to make the pubspec resolve:
Consider downgrading your constraint on cloud_firestore: flutter pub add cloud_firestore:4.9.3

That is (part) my pubspec.yaml:

firebase_core: any 
firebase_analytics: any 
firebase_auth: any 
google_sign_in: any 
google_mobile_ads: any
cloud_firestore: ^4.13.0 
firebase_core_desktop: any
Because no versions of firebase_core_desktop match >1.0.2 and firebase_core_desktop <0.1.1-dev.1 depends on firebase_core_platform_interface ^4.0.1, firebase_core_desktop <0.1.1-dev.1 or >1.0.2 requires firebase_core_platform_interface ^4.0.1.
And because firebase_core_desktop >=0.1.1-dev.1 <1.0.1 depends on firebase_core_platform_interface ^4.1.0 and firebase_core_desktop >=1.0.1 <1.0.2 depends on firebase_core_platform_interface ^4.4.3, firebase_core_desktop <1.0.2-∞ or >1.0.2 requires firebase_core_platform_interface ^4.0.1.
And because firebase_core_desktop 1.0.2 depends on firebase_core_platform_interface ^4.5.0 and cloud_firestore >=4.10.0 depends on firebase_core_platform_interface ^5.0.0, firebase_core_desktop is incompatible with cloud_firestore >=4.10.0.
So, because calc_renda_fixa depends on both cloud_firestore ^4.14.0 and firebase_core_desktop any, version solving failed.

I try to add "firebase_core_platform_interface ", but no luck either.


Solution

  • You can use dependency_overrides in pubspec.yaml file

        dependency_overrides:
         firebase_core_desktop: <specify version here>
         firebase_core_platform_interface: 4.5.1