Skip to content

Authentication hangs with FB and Google login #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JuhaniLehtimaeki opened this issue May 19, 2016 · 26 comments
Closed

Authentication hangs with FB and Google login #121

JuhaniLehtimaeki opened this issue May 19, 2016 · 26 comments
Assignees
Milestone

Comments

@JuhaniLehtimaeki
Copy link
Contributor

I'm using the AuthUI to login to an app I'm migrating to the new Firebase. The old login worked fine but the new one always stops with facebook or google.

Call:
startActivityForResult( AuthUI.getInstance(FirebaseApp.getInstance()) .createSignInIntentBuilder() .setProviders( AuthUI.EMAIL_PROVIDER, AuthUI.GOOGLE_PROVIDER, AuthUI.FACEBOOK_PROVIDER) .build(), RC_SIGN_IN);
The spinner spins forever and the Activity never finishes. Back doesn't do anything.
2016-05-19 00 20 06

Using email works.

I have setup FB app id & secret in the firebase console. The app has been migrated to the new firebase SDK.

There's no errors in console.

Let me know if I can help you debug somehow to get more info to solve the situation. I know this might have too little info to track the issue.

@iainmcgin
Copy link
Contributor

Hey, thanks for playing with FirebaseUI so quickly after the announcement! Do you see any errors in the advanced logs around the time you attempt this? If you wish to attempt to debug, the code for this activity is in AuthenticationMethodPicker. If you are physically at I/O, I'd love to meet and help you diagnose the issue in person. If not, we can continue to correspond here.

@JuhaniLehtimaeki
Copy link
Contributor Author

Hey,
Unfortunately not in the IO this year :-(

I'm not quite sure what you mean by "advanced logs"? Could you point me to some doc to where I can figure out how to access more logging / turn on more logging for this?

Here's a video what's happening when I press the FB login:
https://youtu.be/aQ0W_GD47Kc

There seems to be a lot going on but somehow it hangs at the very end.

Interestingly, when I tried with Google again I get this message to the logcat:
W/AuthMethodPicker: Firebase login unsuccessful
The activity still doesn't finish though.

I keep seeing these errors in the log:
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[

But I'm not 100% if this is related or not.

I'm not able to see much from the console as there seems to be some issues with it right now. The auth part should be correct though (I double checked). For the database side I only see:
screen shot 2016-05-19 at 14 11 30

Which makes me wonder if something failed in the import process from the old data.

Sorry, I know the information is very fragmented. I'm just not sure which is relevant and which isn't. Thank you for your help, much appreciated!

@Queskr
Copy link

Queskr commented May 19, 2016

I get similar hangs.

With FB login, I get:
\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 ...
W/ResourcesManager: getTopLevelResources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in com.queskr.www.queskrandroidapp rsrc of package com.google.android.gms
D/ResourcesManager: For user 0 new overlays fetched Null
E/GmsClient: unable to connect to service: com.google.firebase.auth.api.gms.service.START on com.google.android.gms
W/AuthMethodPicker: Firebase login unsuccessful

With Google and Email Auth it just crashes and gives me:
Caused by: com.google.firebase.FirebaseApiNotAvailableException: API: InternalFirebaseAuth.FIREBASE_AUTH_API is not available on this device.

Any pointers?

@iainmcgin
Copy link
Contributor

@JuhaniLehtimaeki apologies, I typed that message quickly on my phone, "advanced logs" was "adb logs" prior to autocorrect mangling :)

Based on your video, my speculation would be that the interaction with the Facebook SDK is failing for some reason, resulting in a callback to onFailure, which does not dismiss the loading dialog. I'll attempt to verify this, but you might be faster to verify it yourself by adding a call to mActivityHelper.dismissDialog() at that location, and adding a breakpoint to see if it is being hit.

I could also be wrong about this; the error you are seeing in the Firebase dashboard for Database has me concerned that there may be some general configuration error with your project after import. I'll find you a contact who knows more about this part of the toolchain who can help.

@Queskr, the error logs from DynamiteModule are frustrating but not related to the issue you're experiencing, however the error message for the failure to connect to the Firebase Auth service is much more relevant - it looks like your device has not yet updated to the latest Play Services, or you are running on an emulator without Play Services installed. Could you confirm if your device has play services 9.0+? A quick way to do this is using the package manager via adb:

adb shell pm dump com.google.android.gms | grep -B 15 versionName

This will output one or more blocks of version info; look for the one titled "Packages" (not "Hidden system packages") and check that you see versionName=9.X.YY.

Regardless of this, we should do a better job of handling these kinds of errors within FirebaseUI to provide better diagnostics. Sorry for the inconvenience, we intent to rapidly iterate on this library over the next month, so all feedback is incredibly useful to us.

@Queskr
Copy link

Queskr commented May 19, 2016

I've upgraded and I can see Google Play Services 9.0.83 under Settings->Apps->App Manager->Google Play Services.

I still get the same messages for FB which still hangs.
Google login now hands with no messages.
Email auth still crashes with the same message as before "com.google.firebase.FirebaseApiNotAvailableException: API: InternalFirebaseAuth.FIREBASE_AUTH_API is not available on this device"

Any pointers?

Should I just drop the UI package and move to manual authentication? Was this method tested? Does it work?

@puf
Copy link
Contributor

puf commented May 19, 2016

@JuhaniLehtimaeki your database itself is not really modified when you import the project. Can you try to refresh the database screen? Sometimes you get signed out and a refresh would fix that. If it doesn't fix it, can you check the JavaScript console for details about the error?

@Queskr
Copy link

Queskr commented May 19, 2016

You mean the DB screen at the new Firebase Console? Did that, didn't change anything :(
What Javascript console are you referring to? Notice I'm referring to the Android UI library.

Guys, thanks for the assistance. I really appreciate it.

@iainmcgin
Copy link
Contributor

@Queskr the last response from @puf was directed at @JuhaniLehtimaeki's earlier question about the firebase database console (see here). Sorry for the confusion, looks like we have two potentially distinct issues happening that are being covered in this same issue.

As for testing, yes, we tested FB / Google / Email Sign-in and account linking between them prior to this release. It's interesting that you still see the error "InternalFirebaseAuth.FIREBASE_AUTH_API is not available on this device" despite having 9.0.83 of play services. I'll speak to the engineers responsible for the Firebase v2 implementation in Play Services to see if they have any hypothesis as to why this would happen; I don't think what you are seeing is a problem with FirebaseUI, but rather with the underlying Firebase APIs it is built upon. If you could email me direct so I have your contact details we may be able to get some additional information from our backend logs for your device and Firebase project ID.

@iainmcgin
Copy link
Contributor

Opened issue #124 to deal with the loading dialog not being dismissed correctly if auth fails.

@JuhaniLehtimaeki
Copy link
Contributor Author

@iainmcgin @puf Thanks for the help guys! Looks like the issues were unrelated. I talked to someone on the Slack channel who had the same issue with the console. It seems that my initial import did fail and the project got imported only partially. I deleted the imported one and reimported the project and everything now works on the console. That didn't fix the original issue though but I think you already found the problem so we're good.
I'll add any info if I find time to debug the dismiss issue to the #124
Thanks again for the help guys as well as providing us this awesome library! :-)

@Queskr
Copy link

Queskr commented May 20, 2016

Should I open a new issue or continue using this one?
BTW, I've upgraded Google Play Services to 9, cleaned the project and whitelisted all the client IDs that exist in my Google API settings.

Still, both Goole and FB logins hangs and give me the below two errors:

  • 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: ...
  • E/GmsClient: unable to connect to service: com.google.firebase.auth.api.gms.service.START on com.google.android.gms

When trying to auth with mail, it actually crashes:

  • com.google.android.gms.tasks.RuntimeExecutionException: com.google.firebase.FirebaseApiNotAvailableException: API: InternalFirebaseAuth.FIREBASE_AUTH_API is not available on this device.
  • Caused by: com.google.firebase.FirebaseApiNotAvailableException: API: InternalFirebaseAuth.FIREBASE_AUTH_API is not available on this device

@mufaddalgulshan
Copy link

mufaddalgulshan commented May 21, 2016

Hi,

I am facing the same issues as @Queskr, the UI hangs on Loading progress bar and same error "E/GmsClient: unable to connect to service: com.google.firebase.auth.api.gms.service.START on com.google.android.gms" is logged in the logcat.

Google Play Services 9.0.83 is installed on my phone. I am using a Samsung Galaxy S6 running marshmallow to test this (if that helps).

However, no such issues are faced when I run it on a Moto G (3rd gen) device running marshmallow or on a Nexus 5X Emulator

I also posted a question regarding this issue on stackoverflow http://stackoverflow.com/questions/37362970/firebaseui-for-android-gives-error-on-real-device

@peterhav
Copy link
Contributor

Hello, I'm encountering a similar issue using the uiAuth for Email and Google providers. The email provider part works fine, but when clicking on the 'Sign in with Google' button, the "Loading..." dialog keeps showing on my release version (in the debug version this works fine).

The signed APK uses an imported Firebase project (imported during the Google I/O into the new Firebase console) and has the relevant SHA1 set.

The debug version APK is signed using the debug keystore and works on a seperate 'debug' Firebase project (using the SHA1 from the debug keystore) and is created from scratch in the new Firebase console.

@samtstern
Copy link
Contributor

@peterhav you mentioned migrating the release version, have you moved the Client ID (SHA/package name) from the previous Google Cloud project into the appropriate Firebase project?

If not, go to the Credentials page of the Cloud Console for your project and delete the Android Client ID, then add that SHA1 and Package Name to your Firebase project so it is the new owner.

@peterhav
Copy link
Contributor

Hi @samtstern, I migrated and manually added the package name and SHA1 to the Firebase project. I did not remove the old credentials from the Cloud Console: I will try this later today and post the results in this thread.

@mufaddalgulshan
Copy link

Any updates on the issue "E/GmsClient: unable to connect to service: com.google.firebase.auth.api.gms.service.START on com.google.android.gms" when trying to sign in with google?

@peterhav
Copy link
Contributor

I logged into the Cloud Console and removed any Android Client ID's related to this app. Unfortunately this did not help...
I ended up creating a new Firebase project. After adding the package name and SHA1 to this new project everything works fine.

@iainmcgin
Copy link
Contributor

The failure to dismiss the loading dialog is fixed by b605f0c - we're still investigating the issue with the firebase auth API on some devices, see #133 for updates.

@samtstern samtstern reopened this May 25, 2016
@samtstern samtstern added this to the 0.4.1 milestone May 25, 2016
@consp1racy
Copy link

I suggest removing the progress dialog altogether. Google/email signin shows an account picker, facebook shows its own progress dialog/activity/whatever. Having another progress dialog in the background is redundant.

@vsay01
Copy link

vsay01 commented Jun 5, 2016

I have the same issue in which the loading dialog is not dismiss. I try to login using Facebook account. Here is the log.

06-04 19:12:16.174 6415-6908/com.example.vsaya.firebaseauthentication 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/com.example.vsaya.firebaseauthentication-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.vsaya.firebaseauthentication-2/lib/arm64, /vendor/lib64, /system/lib64]]
06-04 19:12:16.178 6415-6908/com.example.vsaya.firebaseauthentication 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/com.example.vsaya.firebaseauthentication-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.vsaya.firebaseauthentication-2/lib/arm64, /vendor/lib64, /system/lib64]]
06-04 19:12:16.576 6415-6415/com.example.vsaya.firebaseauthentication W/AuthMethodPicker: Firebase login unsuccessful
06-04 19:12:26.263 6415-6908/com.example.vsaya.firebaseauthentication 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/com.example.vsaya.firebaseauthentication-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.vsaya.firebaseauthentication-2/lib/arm64, /vendor/lib64, /system/lib64]]
0

I read through the issues chain and change everything possible including the latest version of google play service 9.0.2. Here is my dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
    compile 'com.google.android.gms:play-services:9.0.2'
    compile 'com.google.firebase:firebase-auth:9.0.2'
    compile 'com.firebaseui:firebase-ui-auth:0.4.0'
    testCompile 'junit:unit:4.12'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support:support-annotations:23.4.0'
}

I run the application on Nexus 5x. Did I miss out something? Thank for awesome libraries.

@samtstern
Copy link
Contributor

This issue is now fixed in version 0.4.1, please update your dependencies and thanks for the patience!

@vsay01
Copy link

vsay01 commented Jun 10, 2016

@samtstern Thank, it works.

@branflake2267
Copy link

Works for me too.

@edwoollard
Copy link

I am still receiving the same issue when a user tries to sign via email and they type their password incorrectly.

@samtstern
Copy link
Contributor

@edwoollard what version are you using? Try 0.6.0

@edwoollard
Copy link

I was using 0.5.3. Updated to 0.6.0 and it fixed it though. Thank you, @samtstern!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests