1

So, I have a android project for which i am using google and facebook login, and for that of course i need sha1, debug key.

The scenario is i work in office pc and also in my home pc for the same project and i keep moving and copying project files day to day, but each time i replace my home pc's android project with office pc's project files the sha1, debug key changes. My google and facebook settings at server side are based on my home pc's sha1 and debug key.

How to deal with this situation (except setting up facebook and google console settings each time newly) ?

user3099225
  • 413
  • 1
  • 4
  • 14
  • Always use the same `keystore` file. Android Studio when you install creates new debug keystore file and uses it to sign your `apk`. – Bek Feb 14 '20 at 06:27
  • This link shows how to add signing config to gradle - https://stackoverflow.com/a/40276710/8942811 – Bek Feb 14 '20 at 06:36

2 Answers2

3

Debug SHA1 key is based on pc so,it is change when you have change pc and relase SHA1 is generated base on package name and keystore so,it is never change.

So, You won't have a same debug key for each machine. And you won't have a same debug key for a machine because there is an expiry for the debug key.

For your solution you have need to add both SHA1 in your developer account.

I hope this can help you!

Hardik Talaviya
  • 1,396
  • 5
  • 18
1

There are only tow solution,

One is store both SHA key and Hash Key for both pc in both account, Also both are allowing to store multiple keys so you can store it for multiple pc.

Another one store one release key also for both using Keystore so doing this whenever you sitting on new pc you can test at least creating release APK,

As per my knowledge, there is no other mechanism to do this.

Dhaval Solanki
  • 4,589
  • 1
  • 23
  • 39