question

CARLOS A DE LIMA JR avatar image
CARLOS A DE LIMA JR asked

Invalid API Key

Hi, I followed all the instructions in the link below: https://developer.amazon.com/public/apis/engage/gamecircle/docs/air-ane-2x-build-test#Add%20Your%20API%20Key%20File but I am still getting the following error: E/GameCircleClient( 5725): Unable to read api key. GameCircle requires an api key to be included in 'assets/ api_key.txt'. GameCircle will not initialize. E/GameCircleClient( 5725): java.lang.IllegalArgumentException: Invalid API Key E/GameCircleClient( 5725): at com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager. (AmazonAuthorizationManager.java:126) E/GameCircleClient( 5725): at com.amazon.ags.api.AmazonGamesClient.initialize(AmazonGamesClient.java:144) E/GameCircleClient( 5725): at com.amazon.extensions.android.GameCircleExtensionContext.ffiInit(GameCircleExtensionContext.java:189) E/GameCircleClient( 5725): at com.amazon.extensions.android.GameCircleExtensionContext.access$4700(GameCircleExtensionContext.java:55) E/GameCircleClient( 5725): at com.amazon.extensions.android.GameCircleExtensionContext$GCInitFunction.call(GameCircleExtensionContext.java:1364) E/GameCircleClient( 5725): at com.adobe.air.Entrypoints.EntryMainWrapper(Native Method) E/GameCircleClient( 5725): at com.adobe.air.Entrypoints.EntryMainWrapper(Native Method) E/GameCircleClient( 5725): at com.adobe.air.Entrypoints.EntryMain(Entrypoints.java:139) E/GameCircleClient( 5725): at com.adobe.air.AndroidActivityWrapper.LaunchApplication(AndroidActivityWrapper.java:1001) E/GameCircleClient( 5725): at com.adobe.air.AndroidActivityWrapper.onSurfaceInitialized(AndroidActivityWrapper.java:1200) E/GameCircleClient( 5725): at com.adobe.air.AIRWindowSurfaceView.surfaceChanged(AIRWindowSurfaceView.java:746) E/GameCircleClient( 5725): at android.view.SurfaceView.updateWindow(SurfaceView.java:613) E/GameCircleClient( 5725): at android.view.SurfaceView.access$000(SurfaceView.java:94) E/GameCircleClient( 5725): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:183) E/GameCircleClient( 5725): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:888) E/GameCircleClient( 5725): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2176) E/GameCircleClient( 5725): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1249) E/GameCircleClient( 5725): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6585) E/GameCircleClient( 5725): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803) E/GameCircleClient( 5725): at android.view.Choreographer.doCallbacks(Choreographer.java:603) E/GameCircleClient( 5725): at android.view.Choreographer.doFrame(Choreographer.java:573) E/GameCircleClient( 5725): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789) E/GameCircleClient( 5725): at android.os.Handler.handleCallback(Handler.java:733) E/GameCircleClient( 5725): at android.os.Handler.dispatchMessage(Handler.java:95) E/GameCircleClient( 5725): at android.os.Looper.loop(Looper.java:136) E/GameCircleClient( 5725): at android.app.ActivityThread.main(ActivityThread.java:5586) E/GameCircleClient( 5725): at java.lang.reflect.Method.invokeNative(Native Method) E/GameCircleClient( 5725): at java.lang.reflect.Method.invoke(Method.java:515) E/GameCircleClient( 5725): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) E/GameCircleClient( 5725): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) E/GameCircleClient( 5725): at dalvik.system.NativeStart.main(Native Method) As stated in the link, the api_key.txt file is in the assets folder inside the apk. I appreciate any help. Thanks, Carlos Lima Adobe AIR Mobile Developer
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

Jamie Grossman avatar image
Jamie Grossman answered
Hi there, Thanks for posting. I can see that you have already said that you have added the api_key.txt to your project, but can you please double check you followed the instructions at the bottom of the documentation. It details exactly how to add the file depending on the version of the software you are using to create your app. Otherwise, can you also confirm that you are using the right api key provided by the Amazon dev portal? I can see that you have multiple apps on your account, so please ensure you are using the api key with the apps assigned security profile/game circle configuration. Regards, Jamie
10 |5000

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