I have been following this tutorial to get Google SignOn going: https://developers.google.com/identity/sign-in/android/start-integrating
When I run my application lo
In addition to the above answers, I came across one case where the problem was caused due to the configuration was mismatched to the google-services.json file:
It is also possible that the clientId was specifically assigned in the GoogleSignInOptions Builder as shown below:
String serverClientId = "xxxxx-yyyy.apps.googleusercontent.com";
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.requestIdToken(serverClientId)
.build();
If this is the case, it is possible to remove the reference to the serverClientId and the requestIdToken call as shown below:
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
This would then rely on the google-services.json as opposed to the hard-coded value during configuration.
I hope it saves someone else the trouble that I had trying to diagnose the fault with my project.