com.google.android.gms.common.api.ApiException: 16: User disabled the feature

276 Views Asked by At

I am making an app using Jetpack and Kotlin, I implemented Google oneTap signIn using Firebase. It was working properly, but once I pressed the back button on the sign in popup. That popup screen never showed again. I tried many things like clearing my Google services storage and dialing ##66382723## I also waited more than a day. But still, nothing is working

My logcat is throwing this exception

com.google.android.gms.common.api.ApiException: 16: User disabled the feature.

I have gone through the Google document, several times. But still no clue.

Can someone please help me out?

1

There are 1 best solutions below

2
Alex Mamo On

The following error:

com.google.android.gms.common.api.ApiException: 16: User disabled the feature.

Is thrown when a user cancels several prompts in a row. That's the reason why the official documentation mentions that:

It's important to implement your own rate limiting of One Tap sign-in prompts. If you don't, and a user cancels several prompts in a row, the One Tap client will not prompt the user for the next 24 hours.

In the code example, you can see that is specified to use a REQ_ONE_TAP which is set to 2. In my opinion, this number can be considered a very small number for the retries, but to avoid such situations I recommend you implement your own rate limiting of One Tap sign-in prompts. So in your case, I'm afraid that you have to wait 24 hours until you can see the One Tap sign-in prompts again.

I tried many things like clearing my Google Services storage, dialing ##66382723##

I personally didn't try that but I think it would be more helpful to clear the Google Play services app storage.

P.S. Please also note that One Tap for Android will be deprecated soon. So I recommend you try to implement Credential Manager with Sign in with Google.