Google sign in works good with debug mode but when I have tried same in release version it is not working.
I have tried all solutions which I got while google search, i.e. changing SHA1, rebuilding keystore and chaning SHA1 etc. (reference: https://goo.gl/YryXk3, https://goo.gl/3ZblDF, https://goo.gl/Mvwc2c). I need another solutions or way to debug this problem.
I had the same problem, I've solved it by generating new oauth_client credentials for the release SHA1 fingerprint in google api console for the app and adding that to the google-services.json inside the oauth_client array.
edit:
So you have generated api_key and you need two oauth clients, one for the debug other for the release.
In debug mode it is working well but in release mode it is throwing error object as { "name": "GoogleSigninError", "code": 12501}. I did't got solution for this issue.
Make sure that app is signed with the same certificate that you used to create your google services JSON file. You also have to check your build.gradle file the have the configuration to sign the app in release mode.
There are several solutions in the thread. Likely it comes from a configuration issue.
Most helpful comment
I had the same problem, I've solved it by generating new oauth_client credentials for the release SHA1 fingerprint in google api console for the app and adding that to the google-services.json inside the oauth_client array.
edit:
So you have generated api_key and you need two oauth clients, one for the debug other for the release.