Flutter 2 - firebase_remote_config 0.6.0 & firebase_core ^0.7.0 version conflict

Viewed 1606

As per FlutterFire Documentation, I have updated my flutter project to Flutter 2.

I have converted my project to flutter channel beta and dependency updated as below:

enter image description here enter image description here

Unfortunately, I am getting the following error:

Because firebase_remote_config 0.6.0 depends on firebase_core ^0.7.0 and no versions of firebase_remote_config match >0.6.0 <0.7.0, firebase_remote_config ^0.6.0 requires firebase_core ^0.7.0. So, because mars_remedies depends on both firebase_core ^1.0.0 and firebase_remote_config ^0.6.0, version solving failed. pub get failed (1; So, because mars_remedies depends on both firebase_core ^1.0.0 and firebase_remote_config ^0.6.0, version solving failed.)

Note: I have also tried to use flutter channel dev but I am getting the same error.

Another Error [Updated]:

Because flutter_local_notifications_platform_interface 2.0.0+1 depends on plugin_platform_interface ^1.0.2 and no versions of flutter_local_notifications_platform_interface match >2.0.0+1 <3.0.0, flutter_local_notifications_platform_interface ^2.0.0+1 requires plugin_platform_interface ^1.0.2. So, because mars_remedies depends on both flutter_local_notifications_platform_interface ^2.0.0+1 and plugin_platform_interface ^2.0.0, version solving failed. pub get failed (1; So, because mars_remedies depends on both flutter_local_notifications_platform_interface ^2.0.0+1 and plugin_platform_interface ^2.0.0, version solving failed.)

My pubspec.yaml is:

  # For Location Information (Getting Location Details on Login or Register)
  geolocator: ^7.0.1
  geolocator_platform_interface: ^2.0.0

  flutter_local_notifications: ^4.0.1+1
  flutter_local_notifications_platform_interface: ^2.0.0+1
  plugin_platform_interface: ^2.0.0

All the above dependencies are conflicting with each other.

4 Answers

Try firebase_remote_config: ^0.9.0-dev.0 instead of firebase_remote_config: ^0.6.0.

This version is not null-safe but has been created to allow compatibility with other null-safe FlutterFire packages such as firebase_core.

https://pub.dev/packages/firebase_remote_config/versions/0.9.0-dev.0

If it's still the same, try using firebase_core: ^1.0.0.

As I have done some try & catch, I got the solution by using dependency_overrides

I have posted here : Flutter version solving failed error - after Flutter 2 upgrade

dependency_overrides:
  firebase_auth: ">=1.0.0"
  firebase_core: ">=0.7.0"
  firebase_messaging: ">=8.0.0-dev.14"
  firebase_remote_config: ">=0.6.0"
  firebase_auth_web: ">=0.2.0"
  firebase: ">=7.0.0"
  flutter_local_notifications: ">=4.0.0"

It is just an example. You can use dependency as per your needs.

remove the versions behind messaging and core, it works :

firebase_messaging:

firebase_core:

Related