Wednesday, February 4, 2026
HomeTech PostHow to generate SHA1 and SHA-256 keys on Windows

How to generate SHA1 and SHA-256 keys on Windows

You can generate SHA-1 and SHA-256 keys from your Android project using the VS Code terminal and the Gradle wrapper. These keys are required for specific Firebase services like Google Sign-In and Phone Authentication. 

Prerequisites

  • You must have the Java Development Kit (JDK) installed and configured in your system’s environment variables, as this provides the keytool utility.
  • Your project should contain an Android application structure. 

Step-by-Step Guide

1. Open Your Project in VS Code

Launch VS Code and open the root directory of your project (e.g., your Flutter project folder). 

2. Open the Integrated Terminal

Open the terminal in VS Code by going to the top menu: Terminal > New Terminal, or use the shortcut Ctrl + (backtick)

3. Navigate to the Android Directory 

In the terminal, change your current directory to the android folder of your project: 

bash

cd android

4. Run the Gradle Signing Report Command 

Execute the Gradle command to generate the signing report, which includes the SHA keys. 

  • For Windows, use the following command in the VS Code terminal (which typically uses PowerShell by default):powershell.\\gradlew signingReport
  • Alternatively, for other terminals (like Git Bash or if configured differently):bash./gradlew signingReport  

5. Retrieve the SHA Keys 

The command will run and output the report in the terminal. Look for the SHA1 and SHA-256 fingerprints under the debug variant (or the release variant if you have configured one). 

> Task :app:signingReport
Variant: debug
Config: debug
Store: C:\Users\User\.android\debug.keystore
Alias: AndroidDebugKey
...
SHA1: **54:B0:BC:D6:D6:B4:C3:51:88:E9:20:62:56:CD:23:2D:A7:C0:0F:FD**
SHA-256: **80:BF:B3:A8:0D:D6:D9:7C:C8:5F:61:32:22:6B:EA:D1:51:03:8D:1H:5E:0F:F7:0B:G3:56:1DD1:D1:3B:DB:FA**
Valid until: ...

6. Add the Keys to Your Firebase Project 

  1. Go to the Firebase Console and select your project.
  2. Click the gear icon (Project settings) in the top-left menu.
  3. In the “Your apps” card, select your Android app.
  4. Click the “Add fingerprint” button.
  5. Paste the copied SHA-1 key (and optionally the SHA-256 key) into the field and click Save. You may need to download the updated google-services.json file and replace the existing one in your android/app directory. 
RELATED ARTICLES

4 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments