question

alatook avatar image
alatook asked

Unable to read api key

I have api_key.txt for my app in assets but i am not understand what is mean about the md5 signature i use eclipse to make my signe package. 06-17 14:20:56.480: I/com.amazon.identity.auth.device.appid.AbstractAppIdentifier(5778): Finding API Key for com.spx.ing004.amz 06-17 14:20:56.480: I/com.amazon.identity.auth.device.utils.ThirdPartyResourceParser(5778): Attempting to parse API Key from assets directory 06-17 14:20:56.480: I/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): Begin decoding API Key for packageName=com.spx.ing004.amz 06-17 14:20:56.480: D/com.amazon.identity.auth.device.appid.APIKeyDecoder.PII(5778): APIKey: 06-17 14:20:56.480: I/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): num sigs = 1 06-17 14:20:56.480: D/com.amazon.identity.auth.device.appid.APIKeyDecoder.PII(5778): Signature checking.: 06-17 14:20:56.480: D/com.amazon.identity.auth.device.appid.APIKeyDecoder.PII(5778): Fingerpirint checking: 06-17 14:20:56.500: D/dalvikvm(15885): Late-enabling CheckJNI 06-17 14:20:56.500: D/alsa_pcm(357): sel.id.dev_class= 3 06-17 14:20:56.500: D/alsa_pcm(357): sel.id.dev_sclass = 0 06-17 14:20:56.500: D/alsa_pcm(357): sel.id.card = 0 06-17 14:20:56.500: D/alsa_pcm(357): sel.id.device = 9 06-17 14:20:56.500: D/alsa_pcm(357): sel.id.subdevice = 0 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): Failed to decode: Decoding fails: certificate fingerprint can't be verified! 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): java.lang.SecurityException: Decoding fails: certificate fingerprint can't be verified! 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at com.amazon.identity.auth.device.appid.APIKeyDecoder.verifyPayload(APIKeyDecoder.java:332) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at com.amazon.identity.auth.device.appid.APIKeyDecoder.doDecode(APIKeyDecoder.java:127) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at com.amazon.identity.auth.device.appid.APIKeyDecoder.decode(APIKeyDecoder.java:91) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at com.amazon.identity.auth.device.appid.AbstractAppIdentifier.getAppInfo(AbstractAppIdentifier.java:85) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager. (AmazonAuthorizationManager.java:123) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at com.amazon.ags.api.AmazonGamesClient.initialize(AmazonGamesClient.java:139) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at com.spx.thirds.sGameCircle.sOnResume(sGameCircle.java:55) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at com.spx.thirds.sHandler.sOnResume(sHandler.java:51) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at com.sphinx.game.SOGameActivity.onResume(SOGameActivity.java:410) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1185) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at android.app.Activity.performResume(Activity.java:5248) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2797) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2844) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1290) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at android.os.Handler.dispatchMessage(Handler.java:99) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at android.os.Looper.loop(Looper.java:151) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at android.app.ActivityThread.main(ActivityThread.java:5185) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at java.lang.reflect.Method.invokeNative(Native Method) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at java.lang.reflect.Method.invoke(Method.java:511) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 06-17 14:20:56.500: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(5778): at dalvik.system.NativeStart.main(Native Method) 06-17 14:20:56.500: E/GameCircleClient(5778): Unable to read api key. GameCircle requires an api key to be included in 'assets/ api_key.txt'. GameCircle will not initialize. 06-17 14:20:56.500: E/GameCircleClient(5778): java.lang.IllegalArgumentException: Invalid API Key 06-17 14:20:56.500: E/GameCircleClient(5778): at com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager. (AmazonAuthorizationManager.java:126) 06-17 14:20:56.500: E/GameCircleClient(5778): at com.amazon.ags.api.AmazonGamesClient.initialize(AmazonGamesClient.java:139) 06-17 14:20:56.500: E/GameCircleClient(5778): at com.spx.thirds.sGameCircle.sOnResume(sGameCircle.java:55) 06-17 14:20:56.500: E/GameCircleClient(5778): at com.spx.thirds.sHandler.sOnResume(sHandler.java:51) 06-17 14:20:56.500: E/GameCircleClient(5778): at com.sphinx.game.SOGameActivity.onResume(SOGameActivity.java:410) 06-17 14:20:56.500: E/GameCircleClient(5778): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1185) 06-17 14:20:56.500: E/GameCircleClient(5778): at android.app.Activity.performResume(Activity.java:5248) 06-17 14:20:56.500: E/GameCircleClient(5778): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2797) 06-17 14:20:56.500: E/GameCircleClient(5778): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2844) 06-17 14:20:56.500: E/GameCircleClient(5778): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1290) 06-17 14:20:56.500: E/GameCircleClient(5778): at android.os.Handler.dispatchMessage(Handler.java:99) 06-17 14:20:56.500: E/GameCircleClient(5778): at android.os.Looper.loop(Looper.java:151) 06-17 14:20:56.500: E/GameCircleClient(5778): at android.app.ActivityThread.main(ActivityThread.java:5185) 06-17 14:20:56.500: E/GameCircleClient(5778): at java.lang.reflect.Method.invokeNative(Native Method) 06-17 14:20:56.500: E/GameCircleClient(5778): at java.lang.reflect.Method.invoke(Method.java:511) 06-17 14:20:56.500: E/GameCircleClient(5778): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 06-17 14:20:56.500: E/GameCircleClient(5778): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 06-17 14:20:56.500: E/GameCircleClient(5778): at dalvik.system.NativeStart.main(Native Method) Message was edited by: alatook
10 |5000

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

1 Answer

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Alatook, I think you have not created the api key correctly. Please follow below documentation carefully https://developer.amazon.com/public/apis/engage/gamecircle/docs/create-a-gamecircle-configuration#Step%202:%20Generate%20API%20Keys Either your API key is wrong or you are signing your app with a different certificate than the one your have used to create the API key. Thanks.
10 |5000

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