31

how to get "Sha1" for a flutter application. I am using flutter in Vs code.In android studio we have direct option for that, but i don't know how to get it in Vs code.

8 Answers 8

76

It's very simple follow below steps.

Step 1. Go to your project directory in VS code.

Step 2. Open terminal.

Step 3. Run cd android for the below path :

Ex.: PS D:\Workspace\FlutterWorkSpace\FlutterApp\flutter_demo_app> cd android

Step 4. Run .\gradlew signingReport for the below path :

PS D:\Workspace\FlutterWorkSpace\FlutterApp\flutter_demo_app\android> .\gradlew signingReport

Then it will display like that

> Task :app:signingReport

Variant: debug

Config: debug

Store: C:\Users\User\.android\debug.keystore

Alias: AndroidDebugKey

MD5: 6C:64:D6:49:31:37:60:3F:1D:2E:31:2A:F4:3C:E3:D6

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: Monday, 30 March, 2048
5
  • i dont have android or .android folder
    – Dan
    Jun 13, 2021 at 19:32
  • 2
    Run ./gradlew signingReport for the below path : note the forward slash Sep 3, 2021 at 12:29
  • I get this error .\gradlew : The term '.\gradlew' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. any solution? Jan 11, 2022 at 8:20
  • The code runs, everything is nice, EXCEPT, my VS code trims the output at the top. When i scroll up, the first value i see is > Task :firebase_auth:signingReport Variant: debugAndroidTest. I can't f
    – Simeon
    Jan 21, 2022 at 7:02
  • 1
    i was tring .\gradlew signingReport and it didn't worked because of \ . The correct one is ./gradlew signingReport. Thank you @Rakesh Feb 22 at 5:53
17

open terminal - navigate to root project folder -

cd android && ./gradlew app:signingReport

PS: I tried the above code for my signed project

13
  1. Open a terminal window.

  2. Change the directory to the JDK bin directory, mine was jdk1.7.0_05 (could be different for you). cd

    C:\Program Files\Java\jdk1.7.0_05\bin
    
  3. Next we have to run the keytool.exe. Use the following line to get the Android SHA1 fingerprint. Windows:

    keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore"-alias androiddebugkey -storepass android -keypass android
    

    Mac and Linux:

    keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
    
4
  • @Frank keytool.exe closes as we open it up is there any soltion for it....
    – Jawad
    Jun 27, 2019 at 11:19
  • how do you start keytool? Jun 27, 2019 at 13:51
  • Keystore file does not exist: /Users/builder/.android/debug.keystore Sep 29, 2020 at 18:47
  • I installed jdk; seems like no keytool is shipped in version > 8 Jan 26, 2021 at 14:19
9

Following these steps, that was the only steps that worked for me

  1. Go to your VS project
  2. Open the terminal
  3. cd android
  4. ./gradlew signingReport

That's all ;) your welcome!

8

In windows

  1. Open a terminal window
  2. Run the following command by changing USERNAME

keytool -list -v -keystore "C:\Users\USERNAME\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

  1. Simply get the SHA1
0

1 : open cmd in windows.

2: use cd C:\Program Files\Java\jdk1.7.0_05\bin this will lead you to bin folder of jdk.

3:get path of file debug.keystore that in my case is C:\Users\name\.android\debug.keystore

4: then run this command keytool -list -v -keystore C:\Users\name\.android\debug.keystore -alias androiddebugkey -storepass android - keypass android

this will give you the SHA1

0

in you project root

cd android

./gradlew signingReport

-1
  1. open your terminal make sure you have selected the root folder of your project in that terminal
  2. enter this command:- cd android E:\nitish\FLUTTER LEARNING\UI Design\login_app\android> 3.enter this command :- .\gradlew signingReport and wait for some time...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.