-4

I created an app in android studio and it has a google sign using firebase auth. Everything goes well when I test it on my phone but when the proj. has been transfered to other PC and also build from other phone using that PC (not mine) the google doesnt run at all. They said its because of the SHA-1 because the SHA-1 changes when transfering PC (I think).

Here is my question. Is there any configuration? or tutorial that will create the google sign in, in config or gradle that no matter where i transfer the file. The sign in will work no matter who will build. A public key config or a config that i will include the app folder.

I hope someone helps me. because the best that i did is register my sha1 and also my co dev. in firebase so it works.

  • you both would need the same debug keys added to your local key-stores. – Martin Zeitler Aug 06 '18 at 14:15
  • yes i did that. but in my gradle config the debug keys located on the folder where i selected so if i gave the proj. and that pc run it the debug key doesnt find because it is located on my pc. is there any way that i can call that debug key on the app folder so when i gave it theres no need to reconfigure the debug key – Stygrian Desolator Aug 06 '18 at 14:40

1 Answers1

0

You use SHA-1 of debug key. Debug keys are always different on different computers. So you must generate google-services.json for each of PC for debuging.

BUT if you use release key for build your APK and use he SHA-1 in firebase console then it will work regardless of the computer.

  • i always include the json file in the app. so you mean i will get the pc's sha1 and include to the proj. where i created the the json file so it will work on that. pc – Stygrian Desolator Aug 06 '18 at 14:37
  • You should create release key and use it in different PCs because you can't use one debug key for several PCs. Debug key is unique for each PC – Stanislav Tkach Aug 06 '18 at 14:44
  • i hope you can guide me on that. i will not use any debug key and when i build the apk to my phone it will use the realese key. how can i do that? – Stygrian Desolator Aug 06 '18 at 14:46
  • [Short way](https://stackoverflow.com/questions/18460774/how-to-set-up-gradle-and-android-studio-to-do-release-build) But I recommend to read this [Official instruction](https://developer.android.com/studio/publish/app-signing#releasemode) – Stanislav Tkach Aug 06 '18 at 14:55
  • within signing v2 enabled, it's a upload key and not a release key... best is to only share the debug key. @StanislavTkach it does not matter if the keys generated by default are different, because one can either copy the debug key-store or just import the debug key into the store, assuming it has a unique alias name. – Martin Zeitler Aug 06 '18 at 14:55
  • @MartinZeitler what do you mean share the debug key? beacuse thats the that i red but i dont what does that sharing mean – Stygrian Desolator Aug 06 '18 at 15:00
  • @StygrianDesolator `sharing` means, to either `send the key to your co-developer` ...or add his debug key to Firebase and then download a new one `google-services.json`, and commit that, so that he can check out the version, which contains his key (one can add several debug keys there). – Martin Zeitler Aug 06 '18 at 15:03
  • so you mean i will gave the proj. to my co-dev then i will let him generate his on sha1 include that in my firebase then download the google-service.json and gave it to him to replace the json on proj. so in that way the google sign in will when he build it. – Stygrian Desolator Aug 06 '18 at 15:07