question

ai91 avatar image
ai91 asked

GameCircle initialization, again.

Hello, as many others, I have a problem with initialization of GameCircle. having problems with GameCircle on real Kindles, but works fine on my test devices (I have no Kindle). what works: I've created two API Keys: one 'Debug' and second 'Live'. Game had no security profile. Everything was working fine on my non-amazon devices (ZTE, Galaxy Tab, etc), both with 'Debug' key and with 'Live' key: I was able to initialize GameCircle, sign in with my amazon account, use leaderboards, achievemnts, whispersync, etc. Again, I was trying both API keys: Debug and Live. what doesn't work: When uploaded a new version to the developer's console, during Amazon's verification phase my ACRA reporter got initialization exceptions (which were thrown on Kindle devices). Based on Amazon's verification report, the GameCircle has not been working at all. on next step, I've fixed some NullPointerExceptions (which I've never seen on my devices) (on Amazon devices AmazonGamesClient.getWhispersyncClient() return null), also created a security profile and associated with 'Login with Amazon'. Now, when I go to the 'Security profile', on 'Android/Kindle settings' tab I can see both my API Keys 'Debug' and 'Live'. So my idea was that was a reason for issue on Kindle devices, and new version (with Live key/signature) has been uploaded for verification. But today I've got a report that no GameCircle works. :-( Unfortunately I have no recent logcat's, as after my fix it doesn't crash and doesn't send ACRA reports to me anymore. So now I have no idea what's wrong with app: on my devices it works (with CyanogenMod, without Amazon store), but doesn't work on Amazon's. Additional question: do I need regenerate/redownload API keys after I've created a security profile? Cos my current keys were downloaded when I had no profile. Here is logcat I received from Amazon (I've cut Amazon package names, to make it more readable in forum): I/Activity(14860): Constructing ActvityExender com.amazon.android.app.AmazonActivityExtender. I/Activity(14860): Constructed ActvityExender com.amazon.android.app.AmazonActivityExtender. D/GameCircleClient(14860): SDK Version: 2.4.1 D/AmazonAuthorizationManager.PII(14860): AmazonAuthorizationManager:sdkVer=1.0.0 libVer=3.3.0: I/AmazonAuthorizationManager(14860): Options bundle is null I/AbstractAppIdentifier(14860): getAppInfo : packageName=by.ai91.lyfoes I/AbstractAppIdentifier(14860): Finding API Key for by.ai91.lyfoes I/ThirdPartyResourceParser(14860): Attempting to parse API Key from assets directory I/APIKeyDecoder(14860): Begin decoding API Key for packageName=by.ai91.lyfoes D/APIKeyDecoder.PII(14860): APIKey: I/APIKeyDecoder(14860): num sigs = 1 D/APIKeyDecoder.PII(14860): Signature checking.: D/APIKeyDecoder.PII(14860): Fingerpirint checking: W/APIKeyDecoder(14860): Failed to decode: Decoding fails: certificate fingerprint can't be verified! W/APIKeyDecoder(14860): java.lang.SecurityException: Decoding fails: certificate fingerprint can't be verified! W/APIKeyDecoder(14860): at APIKeyDecoder.verifyPayload(APIKeyDecoder.java:332) W/APIKeyDecoder(14860): at APIKeyDecoder.doDecode(APIKeyDecoder.java:127) W/APIKeyDecoder(14860): at APIKeyDecoder.decode(APIKeyDecoder.java:91) W/APIKeyDecoder(14860): at AbstractAppIdentifier.getAppInfo(AbstractAppIdentifier.java:85) W/APIKeyDecoder(14860): at AmazonAuthorizationManager. (AmazonAuthorizationManager.java:123) W/APIKeyDecoder(14860): at AmazonGamesClient.initialize(AmazonGamesClient.java:144) W/APIKeyDecoder(14860): at by.ai91.lyfoes.b.b.a.a(GameCircleService.java:70) ... E/GameCircleClient(14860): Unable to read api key. GameCircle requires an api key to be included in 'assets/api_key.txt'. GameCircle will not initialize. E/GameCircleClient(14860): java.lang.IllegalArgumentException: Invalid API Key E/GameCircleClient(14860): at AmazonAuthorizationManager. (AmazonAuthorizationManager.java:126) E/GameCircleClient(14860): at AmazonGamesClient.initialize(AmazonGamesClient.java:144) E/GameCircleClient(14860): at by.ai91.lyfoes.b.b.a.a(GameCircleService.java:70)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ai91 avatar image
ai91 answered
Note: now, when I go to GameCircle configuration, to the API Keys, I see three of them: 'Debug', 'Live' and some new 'by.ai91.lyfoes', which I wasn't creating. This new key has strange signature ('3C:F3:38:98:A1:92:3E:2A:D5:55:4C:5A:6F:20:CD:87') which is not mine. Was it created automatically when I created security profile? If yes, what do I need to do with it? btw, when I'm in security profile, I see only my 'Live' and 'Debug' keys. What's going on? I'm totally confused.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

maxnalin avatar image
maxnalin answered
From my limited experience, I can see you got my same initial problems. Your log states at one point "java.lang.SecurityException: Decoding fails: certificate fingerprint can't be verified!" which essentially means you're using the wrong api_key.txt. If you upload the app to your device from Eclipse, you should include the debug api_key.txt which is generated using the MD5 from the debug keystore. If you're uploading the release version, which is the apk you create using Android Tools/Export Signed Application etc., use the release api_key.txt which is generated with the MD5 you see in one of the dialogs. You can always extract MD5s using keytool as per instructions of course. Hope this helps.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ai91 avatar image
ai91 answered
@maxnalin: Thank you for reply. Yes, I've did as suggested, but got a problem. Anyway, today I've got some very strange results. I've asked colleague of mine, who has a Kindle, to install my game from Amazon. And GameCircle is working properly! (very same version which was reported as 'no gamecircle is working'). Now I'm confused. In test-report they wrote that no gamecircle intent observed. Now I have another questions: 1. could it be that my Security Profile changes (which I made just before submission of the game) where not replicated yet in Amazon's infrastructure? So during test-phase there still was not available Amazon-Login feature? And later, when colleague of mine installed the game the replication procedure has finished? 2. what shall I do now? I mean how to resubmit same version for second review (cos lack of gamecircle support is only reason for failing for 'developer support'). On the other hand, what if there is still some issue related to something else? I'm testing in Germany, could it also be a reason for delayed config changes? also could anybody from another region check if gamecircle (leaderboards/achievements) is working on other Kindle devices? Could be found by name: 'Lyfoes'
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tkoba@amazon avatar image
tkoba@amazon answered
Hi ai91, Looks like gamecircle on your app is working correctly. The strange signature that you noted is your app's MD5 signature that Amazon signed for you for the live app. Please look at the following for detail: https://developer.amazon.com/sdk/gamecircle/documentation/submit.html#Section1 As long as you aren't seeing the issue report now, you should be fine when updating the app.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ai91 avatar image
ai91 answered
Yes, seems everything is fine. Have no idea what problem was - I've reuploaded new version, but did no changes related to Amazon API/keys. Note: just noticed, the strange key disappear from my profile. :-)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.