0

a friend and I are trying to develop and Android app.

We want to login with facebook or google accounts. For this we followed the firebase tutorials and for the Facebook case it all works perfect we can sing in and sign out perfect but the problem is when we try to log using google accounts.

My friend is able to log in with his google account but I can't. The GoogleSignInResult is no successful in my case. We both have owner role on google android console.

Any clue what I should look to solve it ? It can be related with the SHA-1 (https://developers.google.com/android/guides/client-auth) ? because we are just run the app through the Android Studio and we don't have any key.

2 Answers2

1

If your app is not a release version and a debug version then you will create a SHA-1 key using these command

keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Ashwini
  • 245
  • 1
  • 7
  • This can be the cause that on of us it's able to login and the other no ? – Adrià Martín Torrens Jul 05 '16 at 09:22
  • Try creating SHA-1 key using above method. It should work! Even i was having the same problem previously. – Ashwini Jul 05 '16 at 09:24
  • Solved ! I've added a new OAuth client ID for Android and I put the SHA-1 key and now I can log in. I've used [this method](http://stackoverflow.com/questions/27609442/how-to-get-the-sha1-fingerprint-certificate-in-android-studio-for-debug-mode) to get the SHA-1 key – Adrià Martín Torrens Jul 05 '16 at 10:18
0

Please make sure that at google api console

https://console.developers.google.com/apis/

you add Product name and email at OAuth Consent Screen.

Chirag Arora
  • 816
  • 8
  • 20
  • I've got this credential *Android client for package.name (auto created by Google Service)* and with this will be enough, no? Or I have to create on manually with the keystore ? – Adrià Martín Torrens Jul 05 '16 at 09:10
  • keystore is ok, but there is also need to add product name for login at Consent screen. check below link https://developers.google.com/identity/sign-in/android/start – Chirag Arora Jul 05 '16 at 09:15
  • Yes, we did all this. The problem it's that on of us it's able to login throught Google and the other no :S – Adrià Martín Torrens Jul 05 '16 at 09:21