Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conflict with using firebase_auth and flutter_localizations packages

The packages firebase_auth and flutter_localizations cause the following error. Is there a way to fix this?

Because firebase_auth >=0.20.1 <0.21.0-1.0.nullsafety.0 depends on firebase_auth_web ^0.3.3 and no versions of firebase_auth match >0.20.0+1 <0.20.1, firebase_auth >0.20.0+1 <0.21.0-1.0.nullsafety.0 requires firebase_auth_web ^0.3.3.
And because firebase_auth 0.20.0+1 depends on firebase_auth_web ^0.3.2+6, firebase_auth >=0.20.0+1 <0.21.0-1.0.nullsafety.0 requires firebase_auth_web ^0.3.2+6.
And because firebase_auth_web >=0.3.0-dev.1 <0.4.0-1.0.nullsafety.0 depends on intl ^0.16.1 and every version of flutter_localizations from sdk depends on intl 0.17.0, firebase_auth >=0.20.0+1 <0.21.0-1.0.nullsafety.0 is incompatible with flutter_localizations from sdk.
So, because geschenk depends on both flutter_localizations any from sdk and firebase_auth ^0.20.0+1, version solving failed.
pub get failed (1; So, because geschenk depends on both flutter_localizations any from sdk and firebase_auth ^0.20.0+1, version solving failed.)
like image 609
Ali Kortak Avatar asked Feb 20 '21 12:02

Ali Kortak


People also ask

Why is Firebase_Auth_web not compatible with flutter_localizations?

Because firebase_auth >=0.18.4 depends on firebase_auth_web ^0.3.2+2 which depends on intl ^0.16.1, firebase_auth >=0.18.4 requires intl ^0.16.1. And because every version of flutter_localizations from sdk depends on intl 0.17.0-nullsafety.2, firebase_auth >=0.18.4 is incompatible with flutter_localizations from sdk.

How to migrate your Flutter App to Android X?

Migrate your flutter app to Android X. Step 2: Import provider package in your pubspec.yaml file and run flutter pub get to upgrade the dependencies. Step 3: make a provider directory in your lib folder and create a file having name auth_provider. Step 4: import the foundation.dart class.

How to create a verification ID variable in Firebase Auth?

First import firebaseAuth.dart i.e: import ‘package:firebase_auth/firebase_auth.dart’; Create a verification id variable of type String.

How do I verify a phone number in Firebase?

//Starts the phone number verification process for the given phone number. //Either sends an SMS with a 6 digit code to the phone number specified, or sign's the user in and [verificationCompleted] is called. In this above method, we verify the phone number with OTP send by the firebase to the user phone number.


Video Answer


2 Answers

I managed to fix this issue by adding the following lines to override the dependencies:

dependency_overrides:
  intl: ^0.17.0-nullsafety.2

My dependencies now look like this:

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  firebase_core: ^0.7.0
  firebase_auth: ^0.20.1

dependency_overrides:
  intl: ^0.17.0-nullsafety.2
like image 92
Ali Kortak Avatar answered Oct 17 '22 16:10

Ali Kortak


You can try this:

dependencies:

firebase_auth_web: 0.3.3

firebase_auth: ^0.20.1

flutter:

sdk: flutter

flutter_localizations:

sdk: flutter

intl:^0.17.0-nullsafety.2

like image 37
nasuhi Avatar answered Oct 17 '22 16:10

nasuhi