Firebase not working com.google.firebase.installations.FirebaseInstallationsException - android
I am working on an Android app, I was in a situation that I want to move the app to a new firebase project, so I removed the old firebase project and created a new one, then I added my app to that project. After that, no firebase functionalities are working.
I have firebase cloud messaging in my app, it was working but it's not working now, I am not receiving FirebaseMessagingService$onNewTokenand also I am using firestore as my back-end database. Inside my .addOnSuccessListener I am getting 0 documents back. It's not failing but returning no documents.
I thought might be a problem with firebase, so I created a test app in node.js and I try to fetch documents from firestore it's working fine.
The android app is not crashing, but checked the error log, and I am seeing the following log.
java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid##20.1.1:54)
at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid##20.1.1:89)
at com.google.firebase.iid.zzv.run(Unknown Source:12)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: com.google.firebase.installations.FirebaseInstallationsException
at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations##16.0.0:333)
at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations##16.0.0:280)
at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
2020-03-05 21:18:49.022 23658-23666/app.spidy.cyberwire E/spidy.cyberwir: Something went wrong getting fds from adb. Retry!: Success
2020-03-05 21:20:11.198 23658-24183/app.spidy.cyberwire E/FirebaseInstanceId: Failed to get FIS auth token
java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid##20.1.1:54)
at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid##20.1.1:89)
at com.google.firebase.iid.zzv.run(Unknown Source:12)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: com.google.firebase.installations.FirebaseInstallationsException
at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations##16.0.0:333)
at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations##16.0.0:280)
at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
2020-03-05 21:22:41.287 23658-24278/app.spidy.cyberwire E/FirebaseInstanceId: Failed to get FIS auth token
java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid##20.1.1:54)
at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid##20.1.1:89)
at com.google.firebase.iid.zzv.run(Unknown Source:12)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: com.google.firebase.installations.FirebaseInstallationsException
at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations##16.0.0:333)
at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations##16.0.0:280)
at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
2020-03-05 21:27:11.330 23658-24399/app.spidy.cyberwire E/FirebaseInstanceId: Failed to get FIS auth token
java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid##20.1.1:54)
at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid##20.1.1:89)
at com.google.firebase.iid.zzv.run(Unknown Source:12)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: com.google.firebase.installations.FirebaseInstallationsException
at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations##16.0.0:333)
at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations##16.0.0:280)
at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
If you have recently change your google-services.json file then just delete build folder from android project and re-build your project.
I had the same problem because access to internet (wifi and mobile) was disabled
I had the same problem (Failed to get FIS auth token) with firebase-messaging version 20.1.1 and 20.1.2. I've solved it by downgrading to 20.1.0.
It looks like Firebase team has some problems with these versions according to Release Notes:
Warning: The following two library versions released with this update have known issues and should not be used: firebase-messaging v20.1.1 and firebase-iid v20.1.0.
Firebase Android SDK updates on February 27 (M65) and afterwards introduced a new infrastructure service, the Firebase Installations SDK which comes with a dependency on the Firebase Installations API.
Firebase Installations requires valid Firebase options API key, project ID, and application ID (a.k.a. "appId") in order to successfully communicate with Firebase servers.
Errors during communication with the Firebase Installations API indicate invalid Firebase options or misconfigurations regarding API keys.
To mitigate the issue
make sure that your application is using valid Firebase options from the latest google-services.json file from your Firebase console:
Firebase options: instructions and background.
If you use API restrictions, make sure that the API key used by your application is white-listed for the Firebase Installations API (and for your application):
API restrictions: instructions and background
Regarding Application restrictions: Either set the radio button to None or make sure that your app is white-listed (with the correct SHA-1 certificate).
For details, please visit:
https://firebase.google.com/support/privacy/init-options
I had the same issue and in my case, my android emulator didn't have Google Play Services added. Created a new one with Google Play Services services and it worked.
Instead of downgrading, enable Firebase Installation API to your firebase key from
Firebase: 403 PERMISSION_DENIED (FirebaseError: Installations): Requests are blocked, after updating SDKs (FirebaseInstallationsService)
Solution 1
If you made any configuration changes in the firebase console - Redownload and update google-services.json file in the project.
Solution 2
If You are using a Real device Check your Internet connection.
If you are using android studio Emulator - Establish an internet connection by resetting the emulator.
2.1. Open Tools -> AVD manager
2.2. Wipe Data of the emulator
Run Project using fresh emulator.
just delete the google-services.json file form the project ,clean project, after that rebuild the project
There could be multiple reasons for the above error. The one which I have faced is due to SHA-1 certificate fingerprint restrictions.
Was facing the above issue for the Android in the store build due to restrictions.
Steps to avoid this error.
Add your SHA-1 certificate fingerprint to the firebase project setup
Also add the same SHA-1 certificate fingerprint in Google Cloud Console.
Steps to add SHA-1 certificate fingerprint to Google Cloud Console:
Open Google Cloud Console & Select your project
Click API`s & Services Tab
Then Select Creditionals
Then go API Section
And Finally, check your SHA-1 Key is added on Restrict usage to your Android apps section or not. If not add it with the package name and SHA-1 Key.
I had the same issue and in my case, so i run two commands "flutter clean" and then "flutter pub get" and it works for me.
I tried all the solutions. Nothing worked. Ultimately I had to delete the Application from the Firebase project, re-create it and add the newly generated google-services.json.
While at it, I also changed the Firebase-flutter dependencies to
firebase_core: ^1.5.0
firebase_messaging: ^10.0.5
And android dependencies to
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:28.3.1')
implementation "com.google.firebase:firebase-messaging:21.0.1"
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.android.support:multidex:1.0.3'
My issue had started after I added the SHA-1 code after setting up the application.
I encountered this on my Flutter app but none of the solutions I found online works. After a dozen hair-pulling hours, what works for me is to run it in release mode via.
flutter build apk
and install it via adb
adb install project/build/app/outputs/flutter-apk/app-release.apk
Replace google-services.json file
Delete project in Firebase console & re-create again
Deleting Generated & Build files
Flutter clean
Non of above worked for me.
I had to change the application id & re-created firebase app again
We also encountered the same issue, while checking the google-services.json file, we found two entries of same key "api_key" .. removing the duplicate entry got the project working.
(Maybe it was due to corrupted json file download from console, which might be solved if downloaded again, as mentioned in the previous answers)
Make sure that your date and time on emulator are correct. It fixes the issue for me.
Related
Can not communicate with Firebase server APIs due to invalid configuration. update Firebase process and set valid options (API key, Project ID ..)
E/Firebase-Installations: Firebase Installations can not communicate with Firebase server APIs due to invalid configuration. Please update your Firebase initialization process and set valid Firebase options (API key, Project ID, Application ID) when initializing Firebase. E/FirebaseMessaging: Failed to get FIS auth token java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException at com.google.android.gms.tasks.Tasks.zza(com.google.android.gms:play-services-tasks##18.0.2:5) at com.google.android.gms.tasks.Tasks.await(com.google.android.gms:play-services-tasks##18.0.2:8) at com.google.firebase.messaging.GmsRpc.setDefaultAttributesToBundle(com.google.firebase:firebase-messaging##23.0.0:10) at com.google.firebase.messaging.GmsRpc.startRpc(com.google.firebase:firebase-messaging##23.0.0:1) at com.google.firebase.messaging.GmsRpc.getToken(com.google.firebase:firebase-messaging##23.0.0:1) at com.google.firebase.messaging.FirebaseMessaging.lambda$blockingGetToken$9$com-google-firebase-messaging-FirebaseMessaging(com.google.firebase:firebase-messaging##23.0.0:1) at com.google.firebase.messaging.FirebaseMessaging$$ExternalSyntheticLambda5.start(Unknown Source:6) at com.google.firebase.messaging.RequestDeduplicator.getOrStartGetTokenRequest(com.google.firebase:firebase-messaging##23.0.0:6) at com.google.firebase.messaging.FirebaseMessaging.blockingGetToken(com.google.firebase:firebase-messaging##23.0.0:7) at com.google.firebase.messaging.SyncTask.maybeRefreshToken(com.google.firebase:firebase-messaging##23.0.0:1) at com.google.firebase.messaging.SyncTask.run(com.google.firebase:firebase-messaging##23.0.0:10) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:463) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement##18.1.0:2) at java.lang.Thread.run(Thread.java:1012) Caused by: com.google.firebase.installations.FirebaseInstallationsException at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:417) at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$3$com-google-firebase-installations-FirebaseInstallations(FirebaseInstallations.java:375) at com.google.firebase.installations.FirebaseInstallations$$ExternalSyntheticLambda0.run(Unknown Source:4) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012) I've cleared caches, changed API key from google cloud platform, updated google-services.json with latest keys. In main branch it didn't get this error but in specific branch. this issue comes.
Firebase is not integrated properly in my Flutter android release builds
Firebase authentication with google signin is getting crashed in my release build app in playstore, however its working fine in local. I had already added release signing keys, app signing from play console in firebase console and all class libraries in my build.gradle file(firebase-auth,proguard rules, firestore), still I am seeing this exception Fatal Exception: java.lang.RuntimeException: Internal error in Cloud Firestore (24.0.1). at com.google.firebase.firestore.w0.x.b(:19) at com.google.firebase.firestore.w0.f.run(:2) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7697) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) in firebase Crashlytics. I will also add the build.gradle files. Could anyone pls help me? I tried some of the suggestions from stackoverflow and other forums, but no luck. 1)pubspec.yaml 2) 3)build.gradle
Follow this documentation https://docs.flutter.dev/deployment/android#publishing-to-the-google-play-store make sure you have all the permissions in res/AndroidManifest (not the debug/AndroidManifest). res/AndroidManifest is used for production!
Crashlytics error: E/FirebaseCrashlytics: Error fetching settings. A valid Firebase Project ID is required to communicate with Firebase server APIs
I am facing this problem it says: Error fetching settings. java.lang.IllegalArgumentException: Please set your Project ID. A valid Firebase Project ID is required to communicate with Firebase server APIs: It identifies your application with Firebase. Please refer to https://firebase.google.com/support/privacy/init-options. 2021-08-09 16:58:43.621 14510-14510/com.stackoverflow I/FirebaseCrashlytics: Initializing Firebase Crashlytics 18.2.0 for com.stackoverflow 2021-08-09 16:58:43.698 14510-14619/com.stackoverflow V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils 2021-08-09 16:58:43.937 14510-14625/com.stackoverflow V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils 2021-08-09 16:58:46.269 14510-14624/com.stackoverflow E/FirebaseCrashlytics: Error fetching settings. java.lang.IllegalArgumentException: Please set your Project ID. A valid Firebase Project ID is required to communicate with Firebase server APIs: It identifies your application with Firebase.Please refer to https://firebase.google.com/support/privacy/init-options. at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(com.google.android.gms:play-services-basement##17.6.0:4) at com.google.firebase.installations.FirebaseInstallations.preConditionChecks(FirebaseInstallations.java:179) at com.google.firebase.installations.FirebaseInstallations.getId(FirebaseInstallations.java:240) at com.google.firebase.crashlytics.internal.common.IdManager.fetchTrueFid(IdManager.java:167) at com.google.firebase.crashlytics.internal.common.IdManager.getCrashlyticsInstallId(IdManager.java:117) at com.google.firebase.crashlytics.internal.settings.network.DefaultSettingsSpiCall.applyHeadersTo(DefaultSettingsSpiCall.java:184) at com.google.firebase.crashlytics.internal.settings.network.DefaultSettingsSpiCall.invoke(DefaultSettingsSpiCall.java:108) at com.google.firebase.crashlytics.internal.settings.SettingsController$1.then(SettingsController.java:199) at com.google.firebase.crashlytics.internal.settings.SettingsController$1.then(SettingsController.java:192) at com.google.android.gms.tasks.zzp.run(Unknown Source:2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:64) at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:27) at java.lang.Thread.run(Thread.java:923) I have downloaded my google-services.json and overwritten the previous one. However, nothing solved. Of cause I have these google-services settings in both project and app level build.gradles. The app has already been enabled at Firebase Console. Why isn't my google-services.json's project_id properly read? implementation platform('com.google.firebase:firebase-bom:28.3.0') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-crashlytics'
I have figured out the cause of this problem. DO NOT UPDATE TO 'com.google.gms:google-services:4.3.9' though Android Studio suggests to that! classpath 'com.google.gms:google-services:4.3.9' I've just reverted it to 4.3.8, the problem is cleared. Currently, the Google's official document only mentions about 4.3.8. Don't trust Android Studio recklessly.
Installation apk in android 8.0 error
I have benn trying for many days to install an app on any device using android oreo either in debug mode with android studio either by creating apk, but I still fail. At the beggining I had issue described here install_failed_no_matching_abis failed to extract native libraries res=-113 after updating to android 8.0 oreo and while I am trying to solve this I get different errors all the time. When I set android.enableAapt2=true I get this error when I set android.enableAapt2=false I get warning The option 'android.enableAapt2' is deprecated and should not be used anymore. Use 'android.enableAapt2=true' to remove this warning. I`t will be removed at the end of 2018..` and finally this error comes up and this in log Mesagges 04-17 01:37:27.331 9763-11258/? E/xiy: Job(ItemMessageAttachmentsCacheEvictorJob#0.126) Enqueued job 'ItemMessageAttachmentsCacheEvictorJob' failed java.lang.IllegalArgumentException: Attachment cache cannot be null. at piu.a(Unknown Source:4) at pki.a(Unknown Source:17) at yik.a(SourceFile:1) at xik.b(SourceFile:2) at xil.a(Unknown Source:4) at yik.a(SourceFile:1) at yhr.run(SourceFile:1) at wzc.run(Unknown Source:3) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:782) Either way I cannot install my app on any device running oreo although it works fine up to nougat.Even if I buld apk ig get error parsing apk file.
Android Firebase DynamiteModule: Failed to load module descriptor
Since upgrading to the newest version of Firebase (9.0.0), I can't get rid of the following two errors when authenticating a user through signInWithEmailAndPassword(). Does anyone have an idea what's going on? 05-19 18:09:49.245 23550-23589/[PACKAGE] E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/[PACKAGE]-3/base.apk"],nativeLibraryDirectories= [/data/app/[PACKAGE]-3/lib/x86, /vendor/lib, /system/lib]] And 05-19 18:09:49.252 23550-23550/[PACKAGE] E/FirebaseApp: Firebase API initialization failure.java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at com.google.firebase.FirebaseApp.zza(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.zzbu(Unknown Source) at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1748) at android.content.ContentProvider.attachInfo(ContentProvider.java:1723) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) (...) Caused by: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.firebase.iid.zzg' appears in /data/data/[PACKAGE]/files/instant-run/dex/slice-com.google.firebase-firebase-iid-9.0.0_95503dc60ed409569d1585da411de93e6c633bf7-classes.dex) at com.google.firebase.iid.zzg.zzeC(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzd.zzb(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at java.lang.reflect.Method.invoke(Native Method) at com.google.firebase.FirebaseApp.zza(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.zzbu(Unknown Source) at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1748) at android.content.ContentProvider.attachInfo(ContentProvider.java:1723) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) (...)
I had the same problem and I found a mistake done by me in my Firebase console. One of the reason for this problem could be, your Sign In Method inside Firebase > Auth Dashboard might be disabled. I just enabled it and it started working.
Can you check your Google Play Services version? From Firebase oficial website: Prerequisites An Android device running Google Play services 9.0.0 or later The Google Play services SDK from the Android SDK Manager Android Studio 1.5 or higher An Android Studio project and its package name.
Very sad that Firebase initialization errors are so not straightforward, so developers need to guess what went wrong. In my case I imported only: compile 'com.google.firebase:firebase-auth:10.2.0' and forgot to import also core: compile 'com.google.firebase:firebase-core:10.2.0' Maybe it will help someone, good luck!
I found the issue. The issue was the first prerequisite Guilherme mentioned, but not the boldfaced part.. Although your dependencies also need to explicitly state 9.+ of the play services part, the devices itself also needs to have 9.+ installed. Debugging on my phone works fine and updating the image of my emulator solves the issue there as well.
Disabling Instant Run worked for me. Sounds ridiculous, I know. I tried cleaning the project. I tried uninstalling/reinstalling the app. The thing that finally did the trick was disabling Instant Run. sigh
I logged out and then logged in and it solved this problem for me. Probably from some kind of synchronization the FB stuff have not implemented. If this problem consist I will try to intercept it. But reallly, this is a bug in Firebase system. And It is a bug that is caused by more than one use case, which is another issue on its own.
You can check out while adding google sign in option Before we use GoogleSignInOptions gso = new GoogleSignInOptions .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail() .build(); add one line as show in the following code GoogleSignInOptions gso = new GoogleSignInOptions .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.default_web_client_id)) .requestEmail() .build(); after adding this if you get the error like An internal error has occured. [ Invalid Idp Response: id_token audience mismatch. ] then Click here to get solution this works for me.
If you just want to use the Firebase authentication and you got here because of the error: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor" Go to https://console.firebase.google.com/project/[your project]/authentication/providers and enable the authentication providers you support.
I had similar issue with signup the user but finally found a working solution. Uninstall the HAXM and reinstall it solves my issue and it successfully signup's the user to firebase auth :)
This answer on another question made my app authenticate Alfonso Gomez Jordana Manas Hello Pierre, You have to manually whitelist your existing Google OAuth 2.0 client IDs in the Firebase console before using it with the new Auth APIs. In order to do so, follow these steps: Go to the Credentials section in the Google API Console. Select from the top right corner the project where you had previously configured Google Sign-In. Go to the OAuth 2.0 client IDs section If you are using Google Sign-In on Android or iOS applications: Take note of the Client ID string corresponding to all the entries registered for your applications. Input these Client IDs into your Firebase project’s configuration: Go to the Firebase console at https://console.firebase.google.com Open the Auth section Under Sign-In methods, open the Google configuration, and add all your client IDs to the whitelist of client IDs from external projects. If you are using Google Sign-In on a web application: Click to open your web client ID and take note of both the client ID and secret. Input this Client ID into your Firebase project’s configuration: Go to the Firebase console at https://console.firebase.google.com Open the Auth section Under Sign-In methods, open the Google configuration, and add the values under the Web SDK configuration section. Let me know if this resolves your issue.
if you do everything but you got nothing try to update your ARM EABI. Google APIs ARM EABI v7a System Image If your emulator has not new goggle updates you will get always auth error. Do everything suggested in this post then update ARM EABI image. This solved my problem.
It may also happen when you don't have the SHA1 fingerprints registered in Firebase and in Google API. There in both of them must register two fingerprints: from the debug keystore and from the production keystore (generated when you create the project's apk for the first time when you enter some password keys on Android Studio). Here shows how to get the SHA1 from there. or run this command on C:\Users\<user name>\.android directory. keytool -list -v -keystore debug.keystore
Sharing my experience: I faced the same issue, I googled everywhere but couldn't find the exact answer, even if I was doing everything as documented by Google Android documentation. Suddenly after a day, my app was working fine and at that same moment I got the email from google stating "Google APIs Explorer connected to your Google Account". And it looks to me that google takes time to grant us access, just wait for this email, maybe this issue is not related to bad code.