-2

I am using Anonymous method to login. When i install the application through USB, it working fine i.e user successfully signed in using sign in Anonymous method, but when i generate signed apk and then test it, authentication get failed with giving an Exception:

The Android package name and signing-certificate fingerprint, package_name and fingerprint, do not match the app restrictions configured on your API key. Please use the API Console to update your key restrictions.

I try to store client_secret.json as suggested in the answer Android Firebase Authentication for Google Signin fails But it doesn't worked. I have enabled SignIn Method in firebase authentication.

And i keep the security as true for now.

Please help me out.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Vinay
  • 11
  • 6

2 Answers2

1

Thats because you need to generate a SHA1 Key for production and paste it into your firebase console

you can refer HERE to see how to do it

Gastón Saillén
  • 12,319
  • 5
  • 67
  • 77
  • 1
    i just checked in project setting, its already there. And i am using firebase realtime database since June, it work fine. – Vinay Feb 06 '18 at 12:50
0

You need to generate SHA1 key for release apk. Debug apk and release apk have different SHA1 key.

divyanshu bhargava
  • 1,513
  • 1
  • 13
  • 24
  • Is there any way to check the sha1 key for debug and relaese apk.? – Vinay Feb 07 '18 at 07:19
  • @Vinay yes, go to your right top corner you will see a tag that says gradle, press there, press app - Tasks - android - press signinReport .... thats all and if you cant see the report you need to toogle textview at the left corner of your log – Gastón Saillén Feb 07 '18 at 12:31
  • for the release sha1 just follow the link i provided – Gastón Saillén Feb 07 '18 at 12:31