69

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) 

(...)
9
  • Which version of Google Play services are you using ? May 19, 2016 at 16:20
  • Try to clean the project and disable the instant run May 19, 2016 at 17:28
  • These are (some of) my dependencies: compile 'com.google.android.gms:play-services-analytics:9.0.0' compile 'com.google.android.gms:play-services-location:9.0.0' 'com.google.android.gms:play-services-gcm:9.0.0' compile 'com.google.android.gms:play-services-wearable:9.0.0' compile 'com.google.firebase:firebase-core:9.0.0' compile 'com.google.firebase:firebase-database:9.0.0' compile 'com.google.firebase:firebase-crash:9.0.0' compile 'com.google.firebase:firebase-auth:9.0.0' compile 'com.google.firebase:firebase-messaging:9.0.0' May 19, 2016 at 17:50
  • 2
    Same error. Seem we can't fix right now.
    – Khang .NT
    May 20, 2016 at 17:34
  • 2
    I am having this problem too and solutions below did not solve it for me. I am using the latest Android Studio off the beta channel, and Google Play Services 9.0.80 on my emulator. Google Play Services 9.0.0 in my build.gradle. I am seeing an identical error. May 21, 2016 at 4:14

13 Answers 13

28

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.

3
  • Solved my problem. I was logging in anonymously. Thanks for the reminder! May 22, 2016 at 18:42
  • Thanks @chandra I have wasted 2 days but when I go to Authentication and enable Email/Password sign in method, it worked for me. Nov 28, 2016 at 7:38
  • 4
    where is Sign In Method inside Firebase > Auth Dashboard?
    – Marcel
    Apr 9, 2017 at 15:49
12

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.
12
  • 4
    That's not a problem with Play Services version. I have the same issue and I'm using version 9.0.0
    – pdegand59
    May 19, 2016 at 17:18
  • Ok, Can you try to run without the instant run? May 19, 2016 at 17:27
  • No instant run either.
    – pdegand59
    May 19, 2016 at 17:37
  • Support library version ? May 19, 2016 at 17:38
  • Also are you using the lasted version of the google play services gradle plugin: ` classpath 'com.google.gms:google-services:3.0.0'` ? May 19, 2016 at 17:41
3

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!

0
1

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.

3
  • The first part of the boldfaced part tells that the device also needs to have 9.+ installed ;) May 19, 2016 at 19:06
  • could you please share code snippets how to fix it? May 20, 2016 at 13:46
  • 2
    Does this mean that the app will crash if the user hasn't got the latest 'Google Play Services'?
    – Steffen
    May 22, 2016 at 10:39
1

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

1

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.

1
  • I am having exactly the same issue with 11.4.2. Did you manage to solve it?
    – txedo
    Oct 14, 2017 at 18:22
0

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.

0

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.

0
0

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 :)

0

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.

1
  • Thx, but I'm tracking my other post for the auth issue. We should keep this thread onlt for the Class Not Found problem.
    – pdegand59
    May 20, 2016 at 14:56
0

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.

0

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
0

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.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.