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:
BaseGameActivity
and GameHelper
to my project (from GitHub)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?
Here's a short overview about what I've tried in the meantime. Nothing helped.
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
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.
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.