0

So, I have an android app which uses GoogleSignInOptions with GoogleApiClient.Builder.

I created a project on the developer console and generated a google-services.json more or less following this: https://developers.google.com/identity/sign-in/android/start

I generated the sha1 from my debug certificate and added the information where it belongs and then whenever i try to login, it seems to work fine. (so far so good)

Now I want to do the same thing but for my release apk which is signed with some keystore. To make sure that things don't get mixed up, I created a brand new project on the developer console following the same steps as for debug. I grabbed the sha1 from my release keystore and entered it in the console and got myself a new google-services.json.

Overall... this is the exact same process as debug except that i'm using the sha1 from my release keystore.

When I try to login, I receive an error saying INVALID_AUDIENCE.

Could I be missing something?

  • no I still haven't managed to solve this. I sort of left it on side for now but it's gonna come back soon. – Francois Coulombe Mar 23 '16 at 17:20
  • Hey man, I found a way to solve it. Of course I don't know if its gonna work for you, but try to delete all the automatically generated keys - or the keys ou generated by yourself - on your Google Developer Console and create new ones. My project started working again after that. o/ – Jefferson Tavares Mar 23 '16 at 17:22

1 Answers1

0

You don't need to create separate projects to hold both the debug and release keys. You just need to create separate Oauth ID credentials on the same project.

See related answers at https://stackoverflow.com/a/45631945/1145905

kip2
  • 6,473
  • 4
  • 55
  • 72