4

In my Android App, elsewhere I am (definitely) firing off an appStateClient.updateStateImmediate with some data in it. But when the callback onStateLoaded finally does fire afterward, the incoming bytes are null. & for the record, am reaching onConnected OK. Code looks like this:

kick off load:

appStateClient.loadState(this, 0);

kick off save:

appStateClient.updateStateImmediate(this, 0, bytes); // bytes have content here

respond to onStateLoaded:

@Override
public void onStateLoaded(int statusCode, int statusKey, byte[] bytes) 
{
    // bytes are null here, statusCode is 7 AKA developer error

Seeing this in log cat:

07-18 09:11:09.402: E/Volley(7866): [3530] ip.a: Unexpected response code 403 for https://www.googleapis.com/appstate/v1/states/0
07-18 09:11:09.472: E/Volley(7866): [3530] ip.a: Unexpected response code 403 for https://www.googleapis.com/appstate/v1/states/0
07-18 09:11:09.482: E/LoadStateOp(7866): Error executing operation: Access Not Configured

I went through the whole APP_ID generation process on the Google API pages, and am using just the integer portion. I've verified I'm using the same SHA1 from debug.keystore which eclipse uses as my OAuth SHA1 on the Google API and the package name there matches my <manifest package > tag.

What have I missed? Thanks in advance

Malachi
  • 2,260
  • 3
  • 27
  • 40
  • This should help: http://stackoverflow.com/a/16601346/1081340? -"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 are up-to-date)" – Vrashabh Irde Jul 23 '13 at 17:36
  • I have fiddled with some of this. I only have the Google API account, not the Google Play Game Services account. I was under the impression you only needed the Google API account. What do you think? – Malachi Jul 26 '13 at 18:06

1 Answers1

1

Have you configured your AndroidManifest.xml with the proper metadata?

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

Without this you'll get a developer error.

  • I have. The APP_ID I'm using is the integer-only prefix on the much longer Client ID – Malachi Jul 26 '13 at 18:07
  • 1
    Have you enabled your account for testing in the "Testers" section in developer console? [https://developers.google.com/games/services/console/testpub#enabling_accounts_for_testing](https://developers.google.com/games/services/console/testpub#enabling_accounts_for_testing). This question may be obvious and dumb, sorry. – franco_valente Jul 27 '13 at 09:08
  • I haven't -- perhaps this is obvious & what I need to do; as I mentioned elsewhere, I only have the Google API account, not the Developer Console which is what your link points to. Do I need Google Play Game Services / Developer Console or should the Google API console be enough? (which was my impression) – Malachi Jul 28 '13 at 23:30
  • I suppose your app is related to gaming. If so i think you need to setup Google Play Game Services through the Developer console. From there you can configure all about the game (leaderboards, achievements, etc..). Through the Google API console you then manage all about usage quotas, reports and traffic controls for your game. Instead, if your app is not about gaming, you have to use Google Drive apis, as the Cloud Save service was designed for a specific purpose: saving and loading of a small amount of application data such as the current score and level progress in a game. Hope this help. – franco_valente Jul 29 '13 at 09:25
  • It's not a game, but close enough since it is indeed using that API. Can anyone state with certainty that indeed I do need to setup the Developer Console for the game API to function? $25 is totally reasonable, however I don't plan to publish anything for quite some time. – Malachi Jul 29 '13 at 23:11