Search code examples
androidfirebaseflutterfirebase-authenticationurl-launcher

firebase auth and url_launcher version conflicts


We are a team working on a small android app using Flutter. When I tried to merge 2 branches, one using firebase (Auth) & the other one using url_launcher. I keep getting this error when trying to flutter pub get

flutter pub get
Running "flutter pub get" in aeroday-2021-main...               
Because no versions of firebase_auth match >0.20.1 <0.21.0 and firebase_auth 0.20.1 depends on firebase_auth_platform_interface ^3.1.0, firebase_auth ^0.20.1 requires firebase_auth_platform_interface ^3.1.0.

And because no versions of firebase_auth_platform_interface match >3.1.0 <4.0.0, firebase_auth ^0.20.1 requires firebase_auth_platform_interface 3.1.0.

And because firebase_auth_platform_interface 3.1.0 depends on plugin_platform_interface ^1.0.2 and url_launcher_platform_interface >=2.0.2 depends on plugin_platform_interface ^2.0.0, firebase_auth ^0.20.1 is incompatible with url_launcher_platform_interface >=2.0.2.

And because url_launcher 6.0.9 depends on url_launcher_platform_interface ^2.0.3 and no versions of url_launcher match >6.0.9 <7.0.0, firebase_auth ^0.20.1 is incompatible with url_launcher ^6.0.9.

So, because aeroday_2021 depends on both url_launcher ^6.0.9 and firebase_auth ^0.20.1, version solving failed.
pub get failed (1; So, because aeroday_2021 depends on both url_launcher ^6.0.9 and firebase_auth ^0.20.1, version solving failed.)
exit code 1

is there any way or work-around to solve this dependencies error?

Pubspec.yaml

    dependencies:
      flutter:
        sdk: flutter
      url_launcher: ^6.0.9
    
    
      # The following adds the Cupertino Icons font to your application.
      # Use with the CupertinoIcons class for iOS style icons.
      google_fonts: ^2.1.0
    
    dev_dependencies:
      flutter_test:
        sdk: flutter
      
      firebase_core: "0.7.0"

      firebase_auth: "^0.20.1"

Solution

  • Update firebase_auth to the following:

    firebase_auth: "^3.1.0"