A Developer
2 min readMay 16, 2021

--

Its a great article and helped very well. However one of the key step that is missed in this documentation is the SHA1 fingerprint during the OAuth Client ID creation. Without the SHA1 fingerprint providedat the time of OAuth creation, this line in your code ` GoogleSignIn.getLastSignedInAccount(this)` will always return null. My assumption is almost every app will require access to GoogleSignInAccount. Can you please update this information in the article? So users will not wonder why it is not working. Below are the steps.

1. On Google API Credential Console Click "Create OAuth client ID"

2. Select Application type as "Android"

3. Give it a friendly "Name" for the client ID, ideally APPNAME-USER-DEBUG or APPNAME-PROJECT-PROD.

4. Enter the package name, you can locate package name for your Android APP in the AndroidManifest.xml under your project.

5. SHA1 fingerprint: Here little explanation is required. Each Android app (apk) is signed using keystore. Yes even your debug apks have keystore that you may not even know. You will need to locate your default keystore on your computer.

You can also have a common keystore file for your project, if you have multiple developers. However in that case your IDE or if you are building APK headless you will need to specify the keystore location and the password.

Otherwise default "debug.keystore is located in the user/username/.android folder". You would need keytool to read the fingerprint. Keytool is a JDK utility shipped with Android studio, locate it in your Android Studio installation "Android\Android Studio\jre\bin"

Then execute `keytool -keystore user\username\.android\debug.keystore -list -v`

Password for the default Android debug.keystore is, yes you guessed it right. It is "android", without the quotes. This will print the keystore details which will include SHA1 fingerprint.

6. Copy and the SHA1 finger print in the SHA1 textbox.

7. Save and now you should see Google Signin Screen and GoogleSignIn.getLastSignedInAccount(context) should return the account handle.

--

--