Bob
Bob

Reputation: 1

Android Studio - error: cannot find symbol class FirebaseAuth

I'm getting these errors in Android:

error: cannot find symbol class FirebaseAuth
error: cannot find symbol variable FirebaseAuth
error: cannot find symbol class OnCompleteListener
error: cannot find symbol class AuthResult

My build.gradle in app:

implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.7'

My build.gradle in project:

classpath 'com.google.gms:google-services:4.1.0'

Upvotes: 0

Views: 2556

Answers (2)

barak
barak

Reputation: 919

REMOVE THIS

rootProject.ext {
  set('FlutterFire', [
    FirebaseSDKVersion: '21.1.0'
  ])
}

in case you added it. works for me.

Upvotes: 0

Md. Nowshad Hasan
Md. Nowshad Hasan

Reputation: 626

Make sure you have added google maven repo at the project level -

allprojects {
    // ...
    repositories {
        google() // Google's Maven repository
        // ...
    }
}

And, add this line at the bottom of app level gradle file -

apply plugin: 'com.google.gms.google-services'

If you're still getting error then change the google service version to

classpath 'com.google.gms:google-services:4.2.0'

For more info, visit Firebase documentation.

Upvotes: 2

Related Questions