Open zjamshidi opened 2 years ago
@zjamshidi I see you're testing in version 7.1.1
of FirebaseUI. Can you please test it in the latest version (8.0.2
)?
We have released a new version with 8.0.1 and I'm waiting for feedbacks.
Same problem here using 8.0.1
.
I have the same problem here using 8.0.2. Phone: Samsung Galaxy A3 a320 firebase-auth: 21.1.0
We had the same problem using 8.0.0, and as a workaround in one of the phones we use for testing, we cleaned the "google play services" cache and it resolves the issue. The list of devices where we have the issue reported:
Xiaomi Redmi 9A/x64/Android 11 API 30 Vivo/x64/Android 12 API 31
com.firebaseui:firebase-ui-auth:8.0.0 com.google.firebase:firebase-bom:30.0.1
Same problem here.
OnePlus Nord 2 / Android 12
com.firebaseui:firebase-ui-auth:8.0.1 com.firebaseui:firebase-ui-storage:8.0.1 com.google.firebase:firebase-bom:30.4.0
Clearing cache and app storage solved the issue.
Digging deeper into the issue where the intent never shows the providers, we(@jftabord) found that the error has something to do with missing credentials in the Smart Lock for passwords and Connected Account at phone vaults.
onCreate@KickoffActivity
until the SignInKickStarter.javaL97
10-27 17:47:28.209 8195 30292 E AuthPII : [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/cclog
10-27 17:47:28.209 8195 30292 E AuthPII : aaky: Long live credential not available.
...
10-27 17:47:28.244 8195 30292 E AuthPII : Message is Long live credential not available.
10-27 17:47:28.244 8195 30292 E AuthPII : aaky: Long live credential not available.
10-27 17:47:28.244 8195 30292 E AuthPII : at kzz.a(:com.google.android.gms@224113024@22.41.13 (100300-480714934):8)
...
10-27 17:47:28.244 8195 30292 W Auth : [GetToken] GetToken failed with status code: BadAuthentication
10-27 17:47:28.258 8195 30292 W Auth : [GoogleAuthUtil] isUserRecoverableError status: BAD_AUTHENTICATION
10-27 17:47:28.259 8195 30292 W GoogleAuthUtil: Error when getting token
4. We believed that it has something to do with credential, therefore, in another physical phone, we changed the password on google's end and we removed the google play services mimicking the situation where the Oauth token is not available. Then we were able to reproduce the bug.
5. There's a special exception `com.google.android.gms.auth.UserRecoverableAuthException` in the same sequences of errors that we guess isn't handled by FirebaseUI. Might be a very rare situation to handle.
operation=List, opStatusCode=11005 [CONTEXT service_id=80 ] 10-27 17:47:46.706 15044 15507 W AsyncOperation: OperationException[Status{statusCode=Error retrieving oauth token, resolution=PendingIntent{4d2f308: android.os.BinderProxy@40e1aa1}}] 10-27 17:47:46.706 15044 15507 W AsyncOperation: at zdl.c(:com.google.android.gms@224113024@22.41.13 (100300-480714934):14) 10-27 17:47:46.706 15044 15507 W AsyncOperation: at zdl.d(:com.google.android.gms@224113024@22.41.13 (100300-480714934):16) 10-27 17:47:46.706 15044 15507 W AsyncOperation: at zdl.f(:com.google.android.gms@224113024@22.41.13 (100300-480714934):4) 10-27 17:47:46.706 15044 15507 W AsyncOperation: at asna.er(:com.google.android.gms@224113024@22.41.13 (100300-480714934):1) 10-27 17:47:46.706 15044 15507 W AsyncOperation: at asng.run(:com.google.android.gms@224113024@22.41.13 (100300-480714934):12) 10-27 17:47:46.706 15044 15507 W AsyncOperation: at cljx.run(:com.google.android.gms@224113024@22.41.13 (100300-480714934):2) 10-27 17:47:46.706 15044 15507 W AsyncOperation: at ablo.c(:com.google.android.gms@224113024@22.41.13 (100300-480714934):6) 10-27 17:47:46.706 15044 15507 W AsyncOperation: at ablo.run(:com.google.android.gms@224113024@22.41.13 (100300-480714934):7) 10-27 17:47:46.706 15044 15507 W AsyncOperation: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 10-27 17:47:46.706 15044 15507 W AsyncOperation: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 10-27 17:47:46.706 15044 15507 W AsyncOperation: at abqt.run(:com.google.android.gms@224113024@22.41.13 (100300-480714934):0) 10-27 17:47:46.706 15044 15507 W AsyncOperation: at java.lang.Thread.run(Thread.java:764) 10-27 17:47:46.706 15044 15507 W AsyncOperation: Caused by: zcm: Error retrieving oauth token 10-27 17:47:46.706 15044 15507 W AsyncOperation: at zib.c(:com.google.android.gms@224113024@22.41.13 (100300 ... 10-27 17:47:46.706 15044 15507 W AsyncOperation: Caused by: com.google.android.gms.auth.UserRecoverableAuthException: BadAuthentication
6. Not being handle the exception `com.google.android.gms.auth.UserRecoverableAuthException` leads to the intent to never return the control the app and users get on a bad situation where the are waiting the activity to start or display an error message.
I'm also seeing this issue with 2 reports in the last couple of days - users unable to get into my app.
Device 1 (Confirmed): Samsung S21+ 5G / Android 12 / Google Play system June 1 2022 Device 2 (Reported not confirmed): Galaxy S10 / Android 12
Environment is: implementation platform('com.google.firebase:firebase-bom:30.3.2') implementation 'com.firebaseui:firebase-ui-auth:8.0.2' implementation 'com.firebaseui:firebase-ui-firestore:6.1.0' implementation 'com.firebaseui:firebase-ui-storage:6.4.0' (with older versions of firestore and storage, I upgraded auth hoping that would address the issue)
List<AuthUI.IdpConfig> providers = Arrays.asList(
new AuthUI.IdpConfig.GoogleBuilder().build()
);
// Create and launch sign-in intent
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.build(),
RC_SIGN_IN);
I had access to device 1 for a couple hours and was able to get some logs and try a few things.
Any suggestions for workarounds?
Some snippets of the logs:
2022-10-28 20:20:25.081 20493-20756/? E/earn: ~~~ Channel {0} was not shutdown properly!!! ~~~
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
java.lang.RuntimeException: ManagedChannel allocation site
at earm.
@thatfiredev Any update on this issue?
Any updates on a work-around or fix for this issue?
It's a gating issue for us as we have users unable to access the app/their data.
Thanks!
After @jftabord reproduced the bug on a demoFirebaseUI app and after we noticed the request was trying to access to credential at the Google Play Services/ Smart Lock https://github.com/firebase/FirebaseUI-Android/blob/5b6c9f01f5a674d754d8e9b1242197fe040086e7/auth/src/main/java/com/firebase/ui/auth/data/remote/SignInKickstarter.java#L97-L121 We have found:
Deactive the Google Smart Lock .setIsSmartLockEnabled(false)
(true by default) has solved the problem for our users. Here why:
The if block statement has two conditions; I will omit the willRequestCredentials
because is normally true
. The other one getArguments().enableCredentials
is set by the setIsSmartLockEnabled@AuthUI.java
which is also set by the Intent created by our apps.
So being the if block statement false
the execution goes down through the method startAuthMethodChoice that somehow returns the control to your app always.
So basically, for some users, Smart Lock might fail and the Intent is not giving back control to the app that has launched it (spinner rolling non-stop) due to failures in the request.
@danielrrv Thanks for the info.
If the user disables smart lock is this a workaround?
Are you planning on pushing this change to FirebaseUI-Android , or did you just make the change for your app locally?
Thanks!
@neilpatrickadams just update your app and give a try.
com.firebase.ui.auth.AuthUI.getInstance()
...
.setIsSmartLockEnabled(false)
.setAlwaysShowSignInMethodScreen(true)
...
.build();
After @jftabord reproduced the bug on a demoFirebaseUI app and after we noticed the request was trying to access to credential at the Google Play Services/ Smart Lock
We have found: Deactive the Google Smart Lock
.setIsSmartLockEnabled(false)
(true by default) has solved the problem for our users. Here why: The if block statement has two conditions; I will omit thewillRequestCredentials
because is normallytrue
. The other onegetArguments().enableCredentials
is set by the setIsSmartLockEnabled@AuthUI.java which is also set by the Intent created by our apps.So being the if block statement
false
the execution goes down through the method startAuthMethodChoice that somehow returns the control to your app always.So basically, for some users, Smart Lock might fail and the Intent is not giving back control to the app that has launched it (spinner rolling non-stop) due to failures in the request.
Life saver!
@neilpatrickadams just update your app and give a try.
com.firebase.ui.auth.AuthUI.getInstance() ... .setIsSmartLockEnabled(false) .setAlwaysShowSignInMethodScreen(true) ... .build();
Thanks this worked (just needed setIsSmartLockEnabled(false)).
when smart lock is enabled and used to launch the sign in flow in 8.0.2 when there is no internet connection it runs off into a loop in the sign in activity and just gives a dim screen. Without smart lock when there is no internet connection the sign in provider flow pops up and reports snackbars check your internet connection as expected.
same issue on Samsung Galaxy tab A
when launches the sign-in intent i get stuck...with infinite loading (waiting 10 minutes and nothing appear).
in my code: .setIsSmartLockEnabled(true) .setAlwaysShowSignInMethodScreen(true)
.gradle:
implementation platform('com.google.firebase:firebase-bom:31.1.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-config'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-firestore'
implementation 'com.google.firebase:firebase-storage'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-inappmessaging-display'
implementation 'com.firebaseui:firebase-ui-auth:8.0.2'
implementation 'com.firebaseui:firebase-ui-storage:8.0.2'
implementation 'com.google.android.gms:play-services-auth:20.4.0'
.... ... ....
when i click on back button
A sign-in error occurred.
v4.j: Unknown error
at com.firebase.ui.auth.KickoffActivity.onActivityResult(SourceFile:66)
at android.app.Activity.dispatchActivityResult(Activity.java:8316)
at android.app.ActivityThread.deliverResults(ActivityThread.java:5237)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5285)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2251)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:233)
at android.app.ActivityThread.main(ActivityThread.java:8068)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
If you have recently upgraded to AGP 8.0 or if you have enabled android.enableR8.fullMode=true
then this might fix it for you:
https://github.com/firebase/firebase-android-sdk/issues/2124#issuecomment-920922929
Describe your environment
Step 3: Describe the problem:
Some users reported the authentication picker activity is not loaded. When they tap on the button which launches the sign-in intent they get stuck.
Steps to reproduce:
I couldn't replicate it on my device.
Observed Results:
I guessed it might be related to Google Smart lock, so I asked the users to remove the credentials or app or even disable it but they didn't help.
Relevant Code: