Google Play Game Services - unable to sign in

AndroidGoogle Play-ServicesGoogle Play-Games

Android Problem Overview


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.

Android Solutions


Solution 1 - Android

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.

Solution 2 - Android

Had the same problem. My solution was to link the same package twice in the Dev Console, the first using the SHA1 fingerprint from my own certificate and the second using my debug key SHA1.

I had tried using just one or just the other before this and it hadn't worked for either.

Solution 3 - Android

After a long 2 weeks trying to fix this problem I have created steps for me to resolve this problem, and decided to share it with every one who is suffering from the same issue, this comes without publishing the game . it is used for testing. when publish time comes I will share the steps used to publish the app and make sure it works with Google play game service.

note that all I was trying to do is sign in using the Google sign in button with no action as to what should happen after sign it, also note that I have used BaseGameUtils from the Google play example as a library, and my IDE of choice to get all of this done was Eclipse.

Below are the steps one by one using eclipse:

1-import BaseGameUtils as a library in your eclipse work space, make sure no error occurs after the import. if an error occurred do the following:

a- right click on the BaseGameUtil project in project explorer

b-Click on Java build path

c-Click add external jars from there navigate to your SDK location and find Google-Play-services.jar

d-select it and click ok ---> you should see the jar added in the JARs and class folders window.

e-Go to the Order and export tab, on the right hand side of libraries and make sure "Android private libraries" and "Android Dependencies" are checked also ensure that the google-play-services.jar is selected.

2- Now make sure you reference your imported BaseGameUtility correctly in the app you want to use ," You can Create a simple hello world application to test this " , so now we will reference the BaseGameUtility in the hello world application as follows:

(important ensure Both hello world and BaseGameUtil are both in the same drive two drives will not work)

a-right click on the hello world application in the right hand side in project explorer

b-click on Java build path

c-Click on Libraries

d- add the android support-v4 if needed from an external or internal source (Not Required)

e- add the base game utils .jard by clicking on add class folder --> then select the BaseGameUtilProject ---Then select the /bin folder --This should import it to your application

f-add google-play-services.jar from an external source also if needed

g-in "order and export" ensure that you have the following selected --->"Android Private Libraries,Android dependancies ,BasegameUtils.jar,GooglePlayGameServices.jar" along with the normal SRC and GEN that should be selected by default.

3- now in your java file helloworld.java ensure that your main screen has all the required imports and then extend the BaseGameUtil and make sure the project implements the ViewOnClickListener.

4- Edit your android manifest to include the following:

 <meta-data android:name="com.google.android.gms.games.APP_ID"
        android:value="@string/app_id" />

and

<uses-permission android:name="android.permission.INTERNET"></uses-permission>

5- ensure that you have a ids.xml file in your resource to include your application ID after you create it.

<string name="app_id"></string>

You can leave it blank for now as later you will have to place the application ID in it

6-copy the debug key you have on your eclipse IDE before you add this application in the developer console. doing so in eclipse happens as follows:

a-click on Window b- select android c-Click build d- copy the SHA1 fingerprint and keep it to use it when creating your app in Developers console.

7- Create your game in developers console and use the SHA1 retrieved from step 6.

8- place the application ID in the ids.xml highlighted in step 5

9- double check your values and ensure that the package names are all correct between the developers console and the manifest file .

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
**package="com.helloword.check"**
android:versionCode="1"
android:versionName="1.0" >

10- When done ensure that the application in the developer console matches the SHA1 that is assigned in developer console using the keytool. This is the step that took me 2 weeks just to figure out

a- locate your application APK from the bin folder of your hello world project, and copy it to another location to check its ID with key tool later

b-locate your keytool --> usually located under the JAVA folder of your computer, in my case it was under C:\Program Files\Java\jdk1.7.0_09\jre\bin

c- Extract your apk in the temp location

d- run the following command

keytool -printcert -file "TempLocation\Meta-INF\CERT.RSA"

you will get an MD5 along with SHA1 and SHA256

Ensure that the SHA1 matches the one in the developers console.

11- Here is how to check your SHA1 from developers console,

a- go to Game Services

b- click the name of the game in our case helloWorld

c- Scroll down to "API Console Project"

d- You should see " this game is linked to the API console Project called helloworld"

e- helloworld should be a hyperlink click it,

f- this will open the Google APis Console

g- in APconsole click on API Access

h- scroll down to "Client IDs for installed application" , you should see the SHA1 ensure it is the same as the one generated from the keytool earlier in step 10 . ( if they don't match you have to delete the game from developers console and recreate it with the correct SHA1 ) " make sure not to change the SHA1 from Google APIs console this will cause issues.

I-Ensure the package name is the same package name in your android manifest, by that I mean everywhere package name is mentioned ensure it matches the one in " Client ID for installed applications" ( in my case it didn't match the one in the line 4 of my manifest)

And that is it you should now be able to test your sign in using google play game service

Solution 4 - Android

In Step 3. Generate an OAuth 2.0 client ID it specifically gives a warning as follows:

> Warning: Do not open the Google APIs Console directly and manually > add your Client IDs on that page. Doing so might cause errors when > you send requests to the game services.

So my experience was that you need to follow the guide religiously: Setting Up Google Play Game Services with the Google Play Developer Console

Solution 5 - Android

I was fighting this problem a lot. Changes in Google APIs Console only break OAuth Client ID- don't touch it. The only solution for me was to create new game service and connect signed apk with normal(not debug) key- because once you add apk with any key, if you will try again to add it with different key it will not work. Deleting game will not work, google will still remember the package name. You can try to change apk package name (of course it is not the best idea) and try again but it is not always work.

So once you will have this problem the best solution is to change apk package name and create new game service - this for sure always work- and please be careful with the game service name - don't make it with name you used earlier - it will mess up everything.

From few problems I have got with this service the funniest is that I now have my apk connected with game service but it is not listed in it and I cannot add it because of an error:This client ID is globally unique and is already in use- I think that client ID is not an OAuth ID - I cannot delete it - there is no such option- and maybe this is a root problem of what we got here.

Solution 6 - Android

Make sure that the ID that you enter in the meta-data is your app id, not your client id. And you can't hardcode it, as it must be an string, you must specify it in your resources and then reference it in your manifest.

Read this for more info:

https://developers.google.com/games/services/console/enabling#c_specify_client_id_settings

> Note: For Android, you do not need to include the full client ID in > your application, as it will be derived automatically from the > application ID.

Solution 7 - Android

I'm experiencing similar issues and I see that this page was updated on 30th May 2013:

https://developers.google.com/games/services/android/troubleshooting

It may help some of us.

Solution 8 - Android

Guy, Have you correctly set up your account for testing ?

See https://developers.google.com/games/services/console/testpub#enabling_accounts_for_testing

> If your game is in an unpublished state, you must whitelist the user accounts that you want to grant access for testing. Otherwise, your testers will encounter OAuth and 404 errors when attempting to access the game services endpoints.

This was the missing step for me. After that I didn't get those errors anymore :

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

Solution 9 - Android

The trick that worked for me was to publish game services configuration since I already had an APK published for alpha testing.

For more details see paragraph "Other causes" in troubleshooting https://developers.google.com/games/services/android/troubleshooting

Solution 10 - Android

Hartok's approach was helping me aswell, however "You might need to delete the projects from google api console." this sound sufficient, but it's not , at least not for me. Google has little "undelete" function in API Console. You can simply restore everything , this means they store your SHA-1 keys, but flagged as deleted(?). What worked for me to use the debug key again, which was also blocked, is that I undeleted all my test projects and manually deleted all OAuth Keys within "API Access" option from all those deleted projects, after that I could use my debug key again. Hope that helps someone...

Solution 11 - Android

Here's a checklist:

  1. First check if you haven't done any silly mistake or mismatches described on https://developers.google.com/games/services/android/troubleshooting

  2. A common problem is a conflicting 'app_id' resource id, for instance, if you're using a Facebook SDK it might be using a key with the same name, so double check that and rename the other ones in case you find conflicts. (I would keep the 'app_id' allocated to this project, as the BaseGameUtils library refers to it as 'app_id' in some source code I checked).

  3. Although the docs refer to 'Google Developers Console' don't play smart and try to add the Client ID's from there. Although, at the end, the Client ID's will be also end up there. There's a small note that can be easily misread:

> You must create the new client ID in the Google Play Developer > Console, not in the Google Developers Console.

  1. So based on this note, create your Client IDs only from the Google Play Developer Console, in other words, by 'Adding a linked app'. So you would usually create 2 linked apps one for using the 'debug.keystore' (using the same package, but with different fingerprints) and another 'linked app' for the 'production' keystore, yet using the same package, but with different fingerprints.

I think this covers all, most people might find themselves in a trap, as all looks fine in Google Developer Console, but in fact, they've probably missed the steps 3 and 4 above.

Solution 12 - Android

Thanks to Sachin Chavan finally solved it, the problems was:

  1. Google play took the wrong sha1.

  2. Tried to add it from the Google Developer Console - didnt work.
    After looking at Sachin Chavan post and link, I saw you can link same app from Google Play Console multiple times, so I took the alias SHA1 with:

    keytool -exportcert
    -alias
    -keystore
    -list -v

and the debug SHA1 with:

keytool -exportcert \
-alias androiddebugkey \
-keystore <path-to-debug-keystore> \
-list -v

I linked the app two more time, first time I entered the alias SHA1 and the second time the debug SHA1, after day of alot of errors, that solved it (the stages in bold).

Solution 13 - Android

Still not working for me. Google did a full reset of my Google Play Game Services, and did step by step the integration. Still said i doesn't have a registered google client ID. Pretty a failure, considering 3 years to make Google Play Games Services.

Last thing, account with @googlemail.com are not recognized, you can't export the IDs of the achievements (you need to copy past the html, when you have 40 achievements, it's quite a pain).

05-22 00:35:57.914: I/dqi(11166): I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond

05-22 00:35:57.914: I/dqi(11166): Retrying request

05-22 00:35:58.135: E/Volley(11166): [506] il.a: Unexpected response code 403 for https://www.googleapis.com/games/v1/players/me

05-22 00:35:58.195: E/Volley(11166): [506] il.a: Unexpected response code 403 for https://www.googleapis.com/games/v1/players/me

05-22 00:35:58.205: E/SignInIntentService(11166): Access Not Configured

05-22 00:35:58.205: E/SignInIntentService(11166): aol

05-22 00:35:58.205: E/SignInIntentService(11166): at ajy.a(SourceFile:108)

05-22 00:35:58.205: E/SignInIntentService(11166): at abm.a(SourceFile:213

05-22 00:35:58.205: E/SignInIntentService(11166): at abm.a(SourceFile:194)

05-22 00:35:58.205: E/SignInIntentService(11166): at aav.a(SourceFile:486)

05-22 00:35:58.205: E/SignInIntentService(11166): at aqu.a(SourceFile:221)

05-22 00:35:58.205: E/SignInIntentService(11166): at com.google.android.gms.games.service.GamesSignInIntentService.onHandleIntent(SourceFile:343)

05-22 00:35:58.205: E/SignInIntentService(11166): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)

05-22 00:35:58.205: E/SignInIntentService(11166): at android.os.Handler.dispatchMessage(Handler.java:99)

05-22 00:35:58.205: E/SignInIntentService(11166): at android.os.Looper.loop(Looper.java:137)

05-22 00:35:58.205: E/SignInIntentService(11166): at android.os.HandlerThread.run(HandlerThread.java:60)

05-22 00:35:58.205: E/LoadSelfFragment(15328): Unable to sign in - application does not have a registered client ID

Solution 14 - Android

In my case I forgot to change package name in AndroidManifest.xml; that was all. I think this should be checked first.

Solution 15 - Android

Please, try this:

  1. Register your app as testing (if not published yet) (on Google developer site).
  2. Make some testing user id and register them over there.
  3. Now write your SHA1 id there.
  4. Note down your developer id generated by Google.
  5. Put it at appropriate place in your app.

If you already do that then follow this most important step.

6 - Now export your app with same keystore and now install it in your device (in which you have logged as tester id, registered on Google).
Now surely you will access Google real time server with out any error.

Solution 16 - Android

Version ID! I had to change my version ID to a value greater than my most recent release. Suddenly I could log in!

For me, I was using a Sample (Button Clicker) and disguising it as one of my released apps. I probably still had to do all the SHA1 changing stuff since it seemed to be off, but the change that tipped in my favor was updating the version id to 3 since the sample starts at 1 and my real/published app was set at 2.

Solution 17 - Android

For me debug signing is working, signed not ;/ Can we contact google about this ? I have spend my all day on it;/ I get "there is no linked app associated with this client ID" but both of them are in Google Api under the right project.

Also i accidentally have two linked and published apps pointing into the same app_ID in developer console, both published and cannot be removed.

Solution 18 - Android

Please check the internet connection when the app is running. If you are not connected, this error message is logged.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionottel142View Question on Stackoverflow
Solution 1 - AndroidHartokView Answer on Stackoverflow
Solution 2 - Androiduser2267794View Answer on Stackoverflow
Solution 3 - AndroidDulliView Answer on Stackoverflow
Solution 4 - AndroidSachin ChavanView Answer on Stackoverflow
Solution 5 - Androiduser2445947View Answer on Stackoverflow
Solution 6 - AndroidAlex CabreraView Answer on Stackoverflow
Solution 7 - AndroidIanBView Answer on Stackoverflow
Solution 8 - AndroidavianeyView Answer on Stackoverflow
Solution 9 - AndroidOndřej ZView Answer on Stackoverflow
Solution 10 - AndroidCaptainCrunchView Answer on Stackoverflow
Solution 11 - AndroidAlécio CarvalhoView Answer on Stackoverflow
Solution 12 - AndroidLiranNisView Answer on Stackoverflow
Solution 13 - AndroidexecomrtView Answer on Stackoverflow
Solution 14 - Androiduser2259824View Answer on Stackoverflow
Solution 15 - AndroidAnkurJatView Answer on Stackoverflow
Solution 16 - AndroidCodeMonkeyView Answer on Stackoverflow
Solution 17 - AndroidPawełView Answer on Stackoverflow
Solution 18 - AndroidKrishna Mohan BandiView Answer on Stackoverflow