2
votes

I would like to test my app with google play services in debug mode. I got the SHA1 key for my debug app and I have added it as client in in google apis. However the connection fails, I'm not able to sign in. In the app Google Play services popup appears but after a while it disappear without signing in.

The connection works well with the release app.

Here is how I build the connection:

   mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(Games.API).addScope(Games.SCOPE_GAMES)
            .build();
2

2 Answers

1
votes

I was having the same problem. The released apk signed in with no trouble but when I tried running it in debug mode (I'm using Eclipse with ADT plugin) it wouldn't sign in. I tried a bunch of stuff, it turns out I had incorrectly typed my Signing-certificate fingerprint for my Debug Client ID. I had typed a 5 instead of a 2 for one of the character sets. I'd recommend triple checking that your certificates correctly match as the problem your having is exactly what I was experiencing.

You can find the certificate you registered by logging into Google Developer Console. Go to Game Services, select the correct application, go to Game Details and scroll to the bottom. Click the link in the sentence "This game is linked to the API console project called ".

Once you click on the link select "APIs & auth" on the side. Select "Credentials" then select the Client ID you want to see the certificate for. You can also modify the certificate from this page.

If you still can't get it try running through this guide https://developers.google.com/games/services/android/troubleshooting

Hope you've figured it out by now, but if not I hope this helps!

0
votes

Check out which key(Google API) does your application uses when it is signed with production certificate.

Go to - https://console.developers.google.com/apis/

you can find under the option credentials the keys that you generated for google login. Add SHA1 of your PC/Mac to that API key(the one your production application uses) along with the package name of your application.