flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

Firebase_auth: deprecated methods warnings

Open under3415 opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

Android

Description

Getting these deprecation warnings when building my project:

FlutterFirebaseAuthPlugin.java:473: warning: [deprecation] fetchSignInMethodsForEmail(String) in FirebaseAuth has been deprecated
        .fetchSignInMethodsForEmail(email)
        ^
FlutterFirebaseAuthUser.java:343: warning: [deprecation] updateEmail(String) in FirebaseUser has been deprecated
        .updateEmail(newEmail)
        ^
2 warnings

Reproducing the issue

Build project with these settings:

pubspec.yaml

  firebase_auth: ^5.1.4
  firebase_core: ^3.3.0
  firebase_crashlytics: ^4.0.4

android/build.gradle

allprojects {
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:deprecation"
        }
    }   
    repositories {
        mavenCentral()
        google()
    }
}

android/app/build.gradle

dependencies {
    implementation platform('com.google.firebase:firebase-bom:33.2.0') 
    //https://firebase.google.com/support/release-notes/android
    implementation 'com.google.firebase:firebase-auth'
    implementation 'com.google.firebase:firebase-crashlytics'
}

Firebase Core version

3.3.0

Flutter Version

3.24.1

Relevant Log Output

\Local\Pub\Cache\hosted\pub.dev\firebase_auth-5.1.4\android\src\main\java\io\flutter\plugins\firebase\auth\FlutterFirebaseAuthPlugin.java:473: warning: [deprecation] fetchSignInMethodsForEmail(String) in FirebaseAuth has been deprecated
        .fetchSignInMethodsForEmail(email)
        ^
\Local\Pub\Cache\hosted\pub.dev\firebase_auth-5.1.4\android\src\main\java\io\flutter\plugins\firebase\auth\FlutterFirebaseAuthUser.java:343: warning: [deprecation] updateEmail(String) in FirebaseUser has been deprecated
        .updateEmail(newEmail)
        ^
2 warnings

Flutter dependencies

Expand Flutter dependencies snippet

Replace this line with the contents of your `flutter pub deps -- --style=compact`.

Additional context and comments

No response

under3415 avatar Aug 24 '24 23:08 under3415

Hi @under3415 . This method has been deprecated in flutterfire. Can you kindly explain how this is causing a problem on your end?

SelaseKay avatar Aug 26 '24 09:08 SelaseKay

It's not causing problems yet. Atm it is just a build warning. I don't use FlutterFire directly, I just have these packages in Flutter project:

  firebase_auth: ^5.1.4
  firebase_core: ^3.3.0
  firebase_crashlytics: ^4.0.4

I thought to raise it here so it can be fixed before it does become a problem...

under3415 avatar Aug 27 '24 08:08 under3415

These packages are part of flutterfire. The above mentioned method has been flagged as deprecated within firebase_auth package and will be removed eventually. Thanks for the report.

SelaseKay avatar Aug 27 '24 08:08 SelaseKay

Closing since we don't have any deadline on possible removal of these APIs.

Lyokone avatar Sep 02 '24 14:09 Lyokone

You should not wait for a deadline to address deprecation warnings. The purpose of deprecation warnings is to give you time to resolve it before it is decommissioned. If you wait for the final notice, you may not have enough time. You don't have to make it the highest priority, but it makes no sense to close it!

under3415 avatar Sep 03 '24 03:09 under3415