3

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

Bonifacius Sarumpaet
  • 1,263
  • 1
  • 8
  • 21
  • Please see https://stackoverflow.com/a/54342861/1674992 for an example of how to use Android Studio to display your debug key. – Lewis Jul 13 '20 at 00:46
  • using android studio, open the android folder of your project and the gradle tab will apper – griffins Jul 13 '20 at 01:07
  • @Christian: actually it helped but when I run gradlew build, it says `unable to start the daemon process` – Bonifacius Sarumpaet Jul 13 '20 at 01:14
  • @griffins: the problem is that I cannot find the gradlw tab, because at the rightmost tab bar are flutter inspector, flutter outline, and flutter performance. No gradle. – Bonifacius Sarumpaet Jul 13 '20 at 01:16
  • when you look at flutter projects they have various folders inside one of them being android. open android folder with android studio and you will get the gradle tab and firebase plugin too. – griffins Jul 13 '20 at 01:24
  • @griffins I clicked at the android folders. Still no gradle tab at the right. But fortunately I already got the answer. – Bonifacius Sarumpaet Jul 13 '20 at 01:46

2 Answers2

18

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.
Guillem Puche
  • 1,199
  • 13
  • 16
Bonifacius Sarumpaet
  • 1,263
  • 1
  • 8
  • 21
2

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

Marius Ruica
  • 441
  • 4
  • 5