Flutter - Get SHA-1 Certificate - Android Studio 3.2.1
Asked Answered
T

6

9

I'm trying to retrieve the SHA-1 Fingerprint Certificate for my Flutter Project. This can usually be done going into the Gradle Panel on the right side in Android Studio and clicking on signingReport.

The problem is however, in Flutter, it doesn't show the Gradle Panel at all and after an hour of searching, I still couldn't find a way to get that panel to show.

I tried the Keytool way, but it tells me there's no such command in the Command Prompt. How do I get the SHA-1 Certificate for my flutter project? I need it for signing in my Flutter Project with Firebase Auth.

I've also searched in the Firebase Documentation, there is no documentation of how to find the SHA-1 in flutter. It simply says that SHA-1 is required for using Firebase Auth.

Related issue https://github.com/flutter/flutter/issues/24776

Tessi answered 26/11, 2018 at 12:25 Comment(2)
Have you tried opening the android/ directory in Android Studio and checked if the menu is available then?Paschall
@Günter Yes I have. I even opened one of the build.gradle files.Tessi
C
26

I had the same problem, to get the SHA-1 there are two ways:

  1. Using Keytool (didn't work with me)
  2. Using Gradle's Signing Report , which I used ,FIrst on terminal go to android folder with command:
cd android               

and the following command to get the report:

./gradlew signingReport

then it will show the signingReport which you can retrieve the SHA-1 from it.

enter image description here

Clad answered 8/9, 2020 at 14:45 Comment(2)
Hi. Thanks! Your answer worked. It doesn't require the chmod command. Directly doing ./gradlew signingReport when in the /android directory of the Flutter Project will work.Tessi
Thank for the neat and clean answer, it works like charmBrookes
U
3

Are you saying that the following option (view Gradle panel) is not at all available?

gradle enable

Underprivileged answered 27/11, 2018 at 12:19 Comment(1)
Not in my flutter project, no. Do you have a flutter project on or a regular Android project? Because I can't see any flutter options in that menu, which would normally be there when working on a flutter project.Tessi
E
1

Authenticating Your Client documents how to obtain your SHA-1 with keytool.

Ento answered 12/2, 2019 at 8:6 Comment(0)
A
1

Use the command from Authenticating Your Client with Command Prompt:

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

If the command doesn't work, then include the path to keytool.exe. For me, that was C:\Program Files\Java\jdk-12.0.2\bin\keytool.exe. So the command I used was as follows:

"C:\Program Files\Java\jdk-12.0.2\bin\keytool.exe" -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
Adena answered 11/11, 2019 at 19:28 Comment(0)
P
0

you should Install Java 8 or 11 and then enter in android folder


cd android

./gradlew clean
./gradlew signingReport

Priddy answered 12/9, 2024 at 12:49 Comment(0)
N
-1

Use this command below if you are using Windows OS. Make sure to replace the username within the path with your username where android studio is installed. You could easily replace the C:\Users\username with the path of your user account where Android studio is installed.

keytool -list -v -keystore "C:\Users\username\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Noctambulism answered 24/8, 2021 at 11:15 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.