SHA-1 / SHA-256

If you want to use the firebase phone authentication or google sign-in, you need to register SHA-1 and SHA-256. I’m using Android Studio as my IDE.

Android

  1. In the Project folders list on the left, open android/app/build.gradle, click on the “Open for Editing in Android Studio” on the top right corner, and once you do so, click on the Gradle tab on the right.
Left: project folder, Right: Gradle Window

2. In the terminal, enter the following :

Mac: keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass androidWindows: keytool -list -v -keystore "\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

You’ll see the information you need in the terminal.

3. There are other variants of SHA-1 and SHA-256. To find that, you need to click on android/app/Tasks/android (in the Gradle window we opened).

If for some reason, you cannot see such folder, go to Preferences and in the bottom Experimental tab, uncheck “Do not build Gradle task list during Gradle sync” box.

Of the various variants that pop up, you need to use the debug variant.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store