question

sbc-games avatar image
sbc-games asked

API key for release

Hi, I need some help with API keys for my app. The debug key works OK for me but I have problems with relese one. I set up Game Circele, created security profile and created two API keys - one for debug from MD5 associated to androiddebugkey and second for release form MD5 associated to my certificate. Next I downloaded api_key.txt (debug) and put it into asssets folder. For testing and debugging this worked OK. But when I wanted to build release I replaced api_key.txt with the release one. And I exported apk signed with my certificate (the same MD5 as for generating realease API key). This apk installs OK, but when run it fails with "Invalid API key" error. I tried to reexport api_key.txt but no success. The game is also connected to security profile. So, currently I can not figure what is wrong. Thanks for help, Tomas
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi, You are doing correct thing and GameCircle should work for your release key. Can you please upload the binary that is signed with your release key and let me know the app name? The app what is integrated with GameCircle in your developer console account, that works fine with GameCircle. I have tested that. Please let me know which app you are trying to test and upload it's apk which is signed by your release certificate. 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.

sbc-games avatar image
sbc-games answered
Hi Sujoy, I have uploaded two binaries to Dropbox and I am sending you the links via Contact us form (or is there any other way how to send it to you privately?) - the first one is signed with release certificate and includes release API key. This one des not work and fails with "invalid API key", - the second one is signed with debug certificate and includes debug API key. This one works OK and connects to Game Circle. The name of the app is "Fruit Dating" and it is registered in developer console with 4 binaries (different API versions, assets resolution and features for TV). But problem is with all of them. This is what I get from your colleagues: "Observation:- App force closes : Steps to reproduce: 1.Install and launch the app. 2.Observe app force closes.". All versions were signed with release API key and includes release API key in assets folder. I put only one of them into the Dropbox (+ the same version with debug API key that works). I have only one release certificate and checked MD5 signature multiple times. I also tried to download the (everchanging) API key several times. But no luck. With debug key everything works OK. I understand that I could re-submit the app with debug key (as Amazon will replace it with their key anyway). But I would prefere to make the way with release certificate work as when signing with it in Eclipse it should also set debugging to false... Please, let me know if you need some additional information. Thanks, Tomas
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Tomas, The problem is neither with release key nor Game Circle. I have launched both of your apks in in my Kindle and the debug build runs well where as release one fails to launch due to below exception java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.sbcgames.fruitdating/com.sbcgames.fruitdating.FruitDating}: java.lang.ClassNotFoundException: Didn't find class "com.sbcgames.fruitdating.FruitDating" on path: /data/app/com.sbcgames.fruitdating-1.apk:/system/app/MetricsApi-2037410.apk:/system/app/com.amazon.dp.logger.apk When I compared both the apks, I saw "com.sbcgames.fruitdating" package is missing in your release build. Other packages still exists in your classes.dex I believe there must be something wrong going on in your build process. Please check. 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.

sbc-games avatar image
sbc-games answered
Hi Sujoy, thank you very much for your help. When I got message from Amazon testers that the app fails, there was not specified which binary of total four is affected. After your message I checked all four APKs and found that main activity class is missing only in the one of them (the one I sent you). This is very strange as this apk was generatd incorrectly repeatly, but only if exported and signed with my certificate. First I tried to generate it again today - again the class was missing (even when I cleand project). Then I just browsed in project properties, looking here and there, and tried to generate the signed APK once more time (I did not change any setting). This time the APK was generated correctly...!? So, it seems that by some chance there was something bad deep in Eclipse and clicking on properties it got corrected / reloaded / or whatever... Tomas
10 |5000

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

sbc-games avatar image
sbc-games answered
Please, consider the problem solved. Thanks again.
10 |5000

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