skip to Main Content

Description: I’m trying to connect an existing flutter project to the new Firestore database I’ve created, which I’m using as a Development database. I’ve built an apk for the app, on which authentication and everything else work fine. But when I run it directly from android studio, authentication doesn’t work.

The SHA1 I generated looks like this:

Variant: debugAndroidTest
Config: debug
Store: C:UsersAlula.androiddebug.keystore
Alias: AndroidDebugKey
MD5: **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**
SHA1: **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**
SHA-256: **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**
Valid until: Wednesday, October 11, 2053

I entered the SHA1 onto the app on the Dev db, got the google-services.json generated, and pasted it under the android/app directory. I also entered the dependencies for google services on build.gradle files.

What should I do differently to run it directly from Android Studio?

2

Answers


  1. you have to add debug sha keys also. to get debug sha key run this command in terminal in your project directory

    keytool -list -v -keystore ~/.android/debug.keystore
    

    you be prompted to enter password enter android as password and you will get debug sha and md5 keys.

    Login or Signup to reply.
  2. Try this for creating SHA1 fingerprint for Debug & Release mode:

    For Debug mode:

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

    For Release mode:

    keytool -list -v -keystore {keystore_name} -alias {alias_name}
    

    Example:

    keytool -list -v -keystore C:UsersShejanDesktopexample.jks -alias example
    

    On windows, when keytool command is not found, Go to your installed JDK Directory e.g. Javajdk1.8.0_231bin, open command line and try the above commands for debug/release mode.

    Another way of getting your SHA1 OR SHA-256 use ./gradlew signingReport

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search