Bonifacius Sarumpaet
Bonifacius Sarumpaet

Reputation: 1601

Where do I get SHA-1 certificate fingerprint using flutter? (using flutter create --androidx ProjectName)

I want to make a simple login page using flutter, and using it with firebase. The first step when I created the project my code:

flutter create --androidx ProjectName

I write this on my IDE Terminal, and it was executed successfully. I can code normally until I have to regiter my project to firebase. I am stuck with getting SHA-1 fingerprint ceritificate in which I don't know where to find.

I have java and android studio installed. When I follow the instructions to code and use keytool at IDE Terminal:

keytool -list -v\ alias androiddebugkey -keystore ~/.android/debug.keystore

it said that alias is an illegal option. And also I can't find gradle tab at rightmost part of android studio window. This was the only thing that hinders my deveopment.

Link to tutorial: https://medium.com/flutter-community/flutter-implementing-google-sign-in-71888bca24ed

Upvotes: 4

Views: 15205

Answers (2)

Marius Ruica
Marius Ruica

Reputation: 471

If you are using VS Code, open a terminal inside your project and then: cd to the android folder and paste this command also in terminal: .\gradlew signingReport

Upvotes: 2

Bonifacius Sarumpaet
Bonifacius Sarumpaet

Reputation: 1601

This sometimes occured when opening the flutter project using android studio, where the gradle tab does not appear at the rightside. To inspect SHA-1, MD5 or SHA-256:

  1. First you need to right-click at the gradlew at android folder, and choose open in terminal.
  2. In the directory type ./gradlew signingReport
  3. if success, it will show you the SHA-1.

Example:

> Task :app:signingReport
Variant: debug
Config: debug
Store: /Users/<your_user>/.android/debug.keystore
Alias: AndroidDebugKey
MD5: 23:..
SHA1: C5:...
SHA-256: 24:...
Valid until: diumenge, 10 / de desembre / 2051
----------
Variant: release
Config: release
Store: /Users/<your_user>/.../<your_flutte_folder>/android/app/android.keystore
Alias: <project_name>
MD5: 6C:...
SHA1: 9D:...
SHA-256: FA:...
Valid until: dijous, 31 / d’agost / 2045
----------
...

IF there is an error around starting the daemon, follow the following steps:

  1. Go to android folder and search for gradle.properties.
  2. Find the org.gradle.jvmargs=-Xmx1536M and change the 1536 to 1024.
  3. Restart the gradlew signingReport process and it should run.

Upvotes: 21

Related Questions