Jithin. S Jithin. S - 2 months ago 93
Android Question

Error:(31, 32) error: cannot find symbol class AuthCredential

Cannot import the following when working with firebase

import com.google.firebase.auth.AuthCredential;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseUser;


Gradle File

compile 'com.google.android.gms:play-services-auth:9.6.1'
compile 'com.google.firebase:firebase-database:9.2.1'
compile 'com.firebase:firebase-client-android:2.5.0'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-auth:9.2.1'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-config:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.6.1'
compile 'com.google.firebase:firebase-crash:9.4.0'

compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'


Is i need anything extra to add to compile

Answer

try to add all fire base dependencies with same version and you have added compile 'com.google.firebase:firebase-auth:9.4.0' dependency it may getting ambiguity with old dependency so remove it and try to add the new dependencies and sync the project. here are the latest dependencies available from fire base.

com.google.firebase:firebase-core:9.6.0     Analytics
com.google.firebase:firebase-database:9.6.0     Realtime Database
com.google.firebase:firebase-storage:9.6.0  Storage
com.google.firebase:firebase-crash:9.6.0    Crash Reporting
com.google.firebase:firebase-auth:9.6.0     Authentication
com.google.firebase:firebase-messaging:9.6.0    Cloud Messaging and Notifications
com.google.firebase:firebase-config:9.6.0   Remote Config
com.google.firebase:firebase-invites:9.6.0  Invites and Dynamic Links
com.google.firebase:firebase-ads:9.6.0  AdMob
com.google.android.gms:play-services-appindexing:9.6.0  App Indexing

for more reference here