firebase / codelab-friendlychat-android

Firebase FriendlyChat codelab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Firebase Auth error

Linawho opened this issue · comments

Hello,

How to fix the errors?=

private FirebaseAuth mFirebaseAuth;
            ^
  symbol:   class FirebaseAuth
  location: class SignInActivity
C:\Users\PC\Documents\build-android-start\app\src\main\java\com\google\firebase\codelab\friendlychat\SignInActivity.java:72: error: cannot find symbol
        mFirebaseAuth = FirebaseAuth.getInstance();
                        ^
  symbol:   variable FirebaseAuth
  location: class SignInActivity
C:\Users\PC\Documents\build-android-start\app\src\main\java\com\google\firebase\codelab\friendlychat\SignInActivity.java:100: error: cannot find symbol
        AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
        ^
  symbol:   class AuthCredential
  location: class SignInActivity
C:\Users\PC\Documents\build-android-start\app\src\main\java\com\google\firebase\codelab\friendlychat\SignInActivity.java:100: error: cannot find symbol
        AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
                                    ^
  symbol:   variable GoogleAuthProvider
  location: class SignInActivity
C:\Users\PC\Documents\build-android-start\app\src\main\java\com\google\firebase\codelab\friendlychat\SignInActivity.java:112: error: cannot find symbol
                .addOnFailureListener(this, new OnFailureListener() {
                                                ^
  symbol:   class OnFailureListener
  location: class SignInActivity
C:\Users\PC\Documents\build-android-start\app\src\main\java\com\google\firebase\codelab\friendlychat\SignInActivity.java:102: error: cannot find symbol
                .addOnSuccessListener(this, new OnSuccessListener<AuthResult>() {
                                                ^
  symbol:   class OnSuccessListener
  location: class SignInActivity
C:\Users\PC\Documents\build-android-start\app\src\main\java\com\google\firebase\codelab\friendlychat\SignInActivity.java:102: error: cannot find symbol
                .addOnSuccessListener(this, new OnSuccessListener<AuthResult>() {
                                                                  ^
  symbol:   class AuthResult
  location: class SignInActivity
Note: C:\Users\PC\Documents\build-android-start\app\src\main\java\com\google\firebase\codelab\friendlychat\MainActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
7 errors

> Task :app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 4s

Thank you.

@Linawho it seems like you're missing imports at the top of your .java file for a bunch of those classes. Normally if you right-click on the missing class (which will have a red squiggly line under it) Android Studio will offer to do this for you.