Firebase: cannot enable google auth and GoogleSignInResult libraries.

I just started with Android, and I'm looking to use Google Firebase to log in to Google. Sorry, I can not import

import com.google.android.gms.auth.api.Auth; import com.google.android.gms.auth.api.signin.GoogleSignInResult; 

The error I get is

 Cannot resolve symbol Auth Cannot resolve symbol GoogleSignInResult 

My build.gradle project looks like

 dependencies { classpath 'com.android.tools.build:gradle:2.1.3' classpath 'com.google.gms:google-services:3.0.0' } 

My build.gradle module looks like

 apply plugin: 'com.google.gms.google-services' ....... ....... ....... dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.2.0' compile 'com.android.support:design:24.2.0' compile 'com.facebook.android:facebook-android-sdk:[4,5)' compile 'com.android.support:support-v4:24.2.0' compile 'com.google.firebase:firebase-auth:9.4.0' compile 'com.google.firebase:firebase-core:9.4.0' } 

Errors also follow

 Error:(229, 29) error: cannot find symbol variable disconnect_button Error:(227, 29) error: cannot find symbol variable sign_out_button Error:(225, 22) error: cannot find symbol variable sign_in_button Error:(214, 5) error: method does not override or implement a method from a supertype Error:(222, 5) error: method does not override or implement a method from a supertype Error:(117, 45) error: package Auth does not exist Error:(60, 25) error: cannot find symbol variable Auth Error:(210, 30) error: cannot find symbol variable sign_out_and_disconnect Error:(206, 13) error: cannot find symbol variable mStatusTextView Error:(201, 55) error: cannot find symbol variable firebase_status_fmt Error:(200, 13) error: cannot find symbol variable mStatusTextView Error:(164, 35) error: package Auth does not exist Error:(151, 44) error: cannot find symbol class GoogleSignInActivity Error:(204, 30) error: cannot find symbol variable sign_out_and_disconnect Error:(12, 39) error: package com.google.android.gms.auth.api does not exist Error:(198, 9) error: cannot find symbol method hideProgressDialog() Error:(174, 13) error: package Auth does not exist Error:(15, 46) error: cannot find symbol class GoogleSignInResult Error:(188, 13) error: package Auth does not exist Error:(59, 108) error: incompatible types: LoginActivity cannot be converted to OnConnectionFailedListener Error:(155, 25) error: cannot find symbol method hideProgressDialog() Error:(200, 55) error: cannot find symbol variable google_status_fmt Error:(206, 45) error: cannot find symbol variable signed_out Error:(117, 13) error: cannot find symbol class GoogleSignInResult Error:(209, 30) error: cannot find symbol variable sign_in_button Error:(201, 13) error: cannot find symbol variable mDetailTextView Error:(207, 13) error: cannot find symbol variable mDetailTextView Error:(203, 30) error: cannot find symbol variable sign_in_button Error:(136, 9) error: cannot find symbol method showProgressDialog() 

Thanks.

+5
source share
2 answers

With these two dependencies:

  compile 'com.google.firebase:firebase-auth:9.4.0' compile 'com.google.firebase:firebase-core:9.4.0' 

You also need to add the one below. This is the part you need to include, which is Play Services Auth, that it:

 compile 'com.google.android.gms:play-services-auth:9.0.2' 

And move apply plugin: 'com.google.gms.google-services' below all these dependencies, finally:

 apply plugin: 'com.google.gms.google-services' 
+11
source

Enable

 dependencies { compile 'com.firebase:firebase-client-android:2.5.2+' } 

If you get a build error complaining about duplicate files, you can exclude these files by adding the packagesOptions directive to the build.gradle file:

 android { ... packagingOptions { exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE-FIREBASE.txt' exclude 'META-INF/NOTICE' } } 
0
source

All Articles