Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Play Game Services - unable to sign in

Right after yesterday's Google I/O keynote I've updated my Android SDK to integrate the game services into one of my apps.

Things I've done so far:

  1. added and linked my app in the Dev Console (game services)
  2. included the OAuth client id into my app/manifest
  3. added BaseGameActivity and GameHelper to my project (from GitHub)
  4. added the google-play-services library to my project
  5. extended BaseGameActivity, added a com.google.android.gms.common.SignInButton

I've also set up game meta data and, of course, some achievements. The dev console states that it is ready to release. To test the login flow and achievements, I've added two Google+ accounts as test users.

But when I test the SignInButton, an alert pops up: Unknown error. Here's the logcat:

ERROR/Volley: il.a: Unexpected response code 403 for https://www.googleapis.com/games/v1/players/me ERROR/SignInIntentService: Access Not Configured ERROR/LoadSelfFragment: Unable to sign in - application does not have a registered client ID 

I've built my application in production mode - using ProGuard and the right certificate.

Did I miss something?

Update - some more attempts

Here's a short overview about what I've tried in the meantime. Nothing helped.

  • remove and recreate the linked Android app entry (double checked certificate fingerprint)
  • disable anti-piracy
  • skip proguard
  • create a new (test) game and use its client id

The problem is not related to the accounts for testing section. Using an account which is not enabled for testing will lead to another error message:

E/GameAgent: Unable to retrieve 1P application 547xxxxxx457 from network E/CheckGameplayAcl: Unable to load metadata for game 

Solution by Hartok!

Hartok's solution helped me a lot to fix this issue. I've never visited the Google APIs Console before. It's important to know, that the OAuth Client ID is not deleted when you remove a linked app from your game or even delete a game (in the Dev Console). You have to visit the APIs Console and remove it manually.

The auto-selected SHA1 fingerprint is (always) wrong! You have to lookup your own:

keytool -exportcert -alias <your-alias> -keystore <path-to-keystore> -list -v 

The new client id of my (correctly) linked app looked like 89xxxxxxxx73-2u6mXXXXXXXXXXXXXXXXXXX8903.apps.goo..., not just 12 digits as before. I finally figured out that you have to exclude the dash and alphanumeric stuff and have to use the 12 digits only.

like image 348
ottel142 Avatar asked May 16 '13 06:05

ottel142


1 Answers

I've fixed this issue.

In my case, when I've linked my app (not yet published) to my Google Play Game Services project, the Certificate Fingerprint auto-selected by Google Play was not the good one.

To fix that, I've deleted my app client ID on Google APIs Console, unlinked my app, then relinked it with the proper Certificate Fingerprint. This Fingerprint is displayed when exporting your app in Eclipse (if your ADT plugin is up-to-date).

Hope it helps.

like image 126
Hartok Avatar answered Oct 01 '22 03:10

Hartok