I'm trying to add google sign in to my app using these instructions: https://developers.google.com/identity/sign-in/android/start-integrating
In my signInActivity I'm getting a null pointer exception on requestIdToken() in the command
mSignInOpt = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.build();
When I use this command without requestIdToken(), it is working perfectly and I'm getting user's name,email etc. in onActivityResult callback, but the token is null.
I made sure that both OAuth 2.0 client IDs in my web console match the ones I use in my app:
I also downloaded google-services.json that the new changes and copied it to my "mobile" folder of the project.
I've tried all the answers in the links below but nothing solved my problem.
Please Help!
Links: