英文:
Firebase Google SignIn not working after few login Android
问题
I am using firebase Google SignIn Authentication, App is working fine initially but after a few tries, login is not successful. Is there any way to test Google auth in debug mode? I tried to put AndroidDebug SHA
key, but it's not working!
Getting this error.
[BeginSignInOperation] BeginSignInOperation failed. [CONTEXT service_id=212 ]
czxt: asco
at asgj.apply(:com.google.android.gms@232316037@23.23.16 (150400-540660214):5)
at cztd.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):2)
at czte.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):10)
at acav.c(:com.google.android.gms@232316037@23.23.16 (150400-540660214):6)
at acav.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at acgd.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at java.lang.Thread.run(Thread.java:923)
Caused by: asco
at ascn.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at asco.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at mnv.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):85)
at asgh.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at cztw.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):2)
at czty.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):9)
I am using:
Google Play service auth
com.google.android.gms:play-services-auth:20.5.0
Firebase Auth
com.google.firebase:firebase-auth-ktx:21.0.3
I followed this example:
https://firebase.google.com/docs/auth/android/google-signin
This is how I provide an object for SignIn and signUp:
@Provides
@Named(SIGN_IN_REQUEST)
fun provideSignInRequest(
app: Application
) = BeginSignInRequest.builder()
.setGoogleIdTokenRequestOptions(
BeginSignInRequest.GoogleIdTokenRequestOptions.builder()
.setSupported(true)
.setServerClientId(app.getString(R.string.default_web_client_id))
.setFilterByAuthorizedAccounts(false)
.build()
)
.setAutoSelectEnabled(false)
.build()
@Provides
@Named(SIGN_UP_REQUEST)
fun provideSignUpRequest(
app: Application
) = BeginSignInRequest.builder()
.setGoogleIdTokenRequestOptions(
BeginSignInRequest.GoogleIdTokenRequestOptions.builder()
.setSupported(true)
.setServerClientId(app.getString(R.string.default_web_client_id))
.setFilterByAuthorizedAccounts(false)
.build()
)
.build()
Here I am calling in my repo:
override suspend fun oneTapSignInWithGoogle(): OneTapSignInResponse {
return try {
val signInResult = oneTapClient.beginSignIn(signInRequest).await()
Response.Success(signInResult)
} catch (e: Exception) {
try {
val signUpResult = oneTapClient.beginSignIn(signUpRequest).await()
Response.Success(signUpResult)
} catch (e: Exception) {
Response.Failure(e)
}
}
}
英文:
I am using firebase Google SignIn Authentication, App is working fine initially but after few try , login is not getting any success , is there any way to test google auth in debug mode, I tried to put AndroidDebug SHA
key but its not working !
Getting this error.
[BeginSignInOperation] BeginSignInOperation failed. [CONTEXT service_id=212 ]
czxt: asco
at asgj.apply(:com.google.android.gms@232316037@23.23.16 (150400-540660214):5)
at cztd.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):2)
at czte.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):10)
at acav.c(:com.google.android.gms@232316037@23.23.16 (150400-540660214):6)
at acav.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at acgd.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at java.lang.Thread.run(Thread.java:923)
Caused by: asco
at ascn.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at asco.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at mnv.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):85)
at asgh.a(:com.google.android.gms@232316037@23.23.16 (150400-540660214):0)
at cztw.d(:com.google.android.gms@232316037@23.23.16 (150400-540660214):2)
at czty.run(:com.google.android.gms@232316037@23.23.16 (150400-540660214):9)
I am using
Google Play service auth
com.google.android.gms:play-services-auth:20.5.0
Firebase Auth
com.google.firebase:firebase-auth-ktx:21.0.3
I followed this example
https://firebase.google.com/docs/auth/android/google-signin
This is how I provide object for SignIn and signUp
@Provides
@Named(SIGN_IN_REQUEST)
fun provideSignInRequest(
app: Application
) = BeginSignInRequest.builder()
.setGoogleIdTokenRequestOptions(
BeginSignInRequest.GoogleIdTokenRequestOptions.builder()
.setSupported(true)
.setServerClientId(app.getString(R.string.default_web_client_id))
.setFilterByAuthorizedAccounts(false)
.build()
)
.setAutoSelectEnabled(false)
.build()
@Provides
@Named(SIGN_UP_REQUEST)
fun provideSignUpRequest(
app: Application
) = BeginSignInRequest.builder()
.setGoogleIdTokenRequestOptions(
BeginSignInRequest.GoogleIdTokenRequestOptions.builder()
.setSupported(true)
.setServerClientId(app.getString(R.string.default_web_client_id))
.setFilterByAuthorizedAccounts(false)
.build()
)
.build()
Here I am calling in my repo
override suspend fun oneTapSignInWithGoogle(): OneTapSignInResponse {
return try {
val signInResult = oneTapClient.beginSignIn(signInRequest).await()
Response.Success(signInResult)
} catch (e: Exception) {
try {
val signUpResult = oneTapClient.beginSignIn(signUpRequest).await()
Response.Success(signUpResult)
} catch (e: Exception) {
Response.Failure(e)
}
}
}
答案1
得分: 1
Are you using a phone identification? For some of the authentication methods you need to identify the testing accounts or else it will block them to avoid spams. On top of that, there is a max quota for free accounts per day (for SMS it's 50).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论