question

mnedev avatar image
mnedev asked

Help, can't bind Game Circle, error: CANNOT_BIND?

Hi, I'm trying to initialize Game Circle for my game. But I get these errors in logcat: 07-31 14:01:50.859: E/AGC_ServiceProxy(730): Amazon Games Service is not available 07-31 14:01:50.859: D/AGC_ServiceProxy(730): Changing Status from:INITIALIZING to: CANNOT_BIND 07-31 14:01:50.859: E/GC_AmazonGamesClient(730): Failed to enable softkey button: android.content.pm.PackageManager$NameNotFoundException: com.amazon.ags.app I registered my Amazon app's package name (ie: com.companyname.gamename) into the Whitelist Registry. How do you fix the error? Thank you
10 |5000 characters needed characters left characters exceeded

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

mnedev avatar image
mnedev answered
Here's some snippets of my code, in the main Activity class file: private boolean bAmazonGamesServiceInit = false; private GameNameAmazonCallback mGameNameAmazonCallback = null; EnumSet myGameFeatures = EnumSet.of(AmazonGamesFeature.Leaderboards); public class GameNameAmazonCallback implements AmazonGamesCallback { @Override public void onServiceReady() { bAmazonGamesServiceInit = true; } @Override public void onServiceNotReady(AmazonGamesStatus reason) { bAmazonGamesServiceInit = false; switch (reason) { /** * The service could not bind either because it does not * exist, or permissions have not been granted. * This will also occur when your game is executed on a non-fire device * that does not have Amazon Game Services installed */ case CANNOT_BIND: { /** * The service could not authorize the client. This * should only occur if the network is not available the * first time the game attempts to connect. */ Log.d(Globals.sApplicationName, "CANNOT_BIND"); break; } case CANNOT_AUTHORIZE: { /** * The game in not authorized to use the service. Check * your package name and signature registered in the * Developer's Portal */ Log.d(Globals.sApplicationName, "PanarchyAmazonCallback: CANNOT_AUTHORIZE"); break; } case NOT_AUTHORIZED: { /** * The device is not registered with an account */ Log.d(Globals.sApplicationName, "PanarchyAmazonCallback: NOT_AUTHORIZED"); break; } case NOT_AUTHENTICATED: { /** * Disable Amazon Game Services features in Game UI */ Log.d(Globals.sApplicationName, "NOT_AUTHENTICATED"); break; } } } } protected void onCreate ( Bundle savedInstanceState ) { // Call parent constructor // super.onCreate ( savedInstanceState ) ; // Get singleton // oThis = this ; if (Constants.IS_KINDLE_FIRE == false) { Store.getInstance().init(oThis); Store.getInstance().checkBillingSupport(); } if (mGameNameAmazonCallback == null) { mGameNameAmazonCallback = new mGameNameAmazonCallback (); AmazonGamesClient.initialize(getApplication(), mGameNameAmazonCallback, myGameFeatures); } etc...
10 |5000 characters needed characters left characters exceeded

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

Jim Liu avatar image
Jim Liu answered
Hi mnedev. Couple questions: 1) Are you running this code on a Kindle Fire? 2) Which version of the GameCircle API are you using in your game? The latest version is 1.2.0. If you aren't using that version, please update your game. Please let me know if either of these ideas help.
10 |5000 characters needed characters left characters exceeded

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

g4m3c0d3r avatar image
g4m3c0d3r answered
I am actually get this same error, but only when I run the release build (signed by our release key) of our game. When I run the debug build GameCircle works fine, but running the release build gives me this error in the log: 08-07 12:46:58.100: E/AGC_ServiceProxy(7313): Amazon Games Service is not available 08-07 12:46:58.100: D/AGC_ServiceProxy(7313): Changing Status from:INITIALIZING to: CANNOT_BIND 08-07 12:46:58.100: E/GC_AmazonGamesClient(7313): Failed to enable softkey button: android.content.pm.PackageManager$NameNotFoundException: com.amazon.ags.app 08-07 12:46:58.100: I/AGC_AmazonGamesStatusHandler(7313): Game received status update of: CANNOT_BIND I have double checked that I have my release binary white listed, along with the debug binary. I am running it on a Kindle Fire with version 1.2.0 of the GameCircle API. Thanks for any advice! -Kevin.
10 |5000 characters needed characters left characters exceeded

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

g4m3c0d3r avatar image
g4m3c0d3r answered
I found the cause of this issue, at least in my case. The Kindle Fire we had trouble with was not yet registered to an account, and therefor didn't have the latest version of the software either. I resolved both issues and now GameCircle works just fine on our release builds.
10 |5000 characters needed characters left characters exceeded

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

Jim Liu avatar image
Jim Liu answered
Great! Thanks for follow-up to tell us what the solution was. I'll add it to our troubleshooting knowledge base.
10 |5000 characters needed characters left characters exceeded

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

mnedev avatar image
mnedev answered
Hi, I was running GameCircle 1.2.0. I just downloaded and now running GameCircle 1.2.1. When I run my debug apk on a Kindle Fire, I get CANNOT_AUTHORIZE error. I have registered my package name as a new app on Amazon's Apps. I have set the Whitelist registry with the debug key. Is there anything else I should check? My Kindle Fire is registered to an account name that is different from my developer's account. The Kindle Fire is fully updated. Thanks
10 |5000 characters needed characters left characters exceeded

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

mnedev avatar image
mnedev answered
Hi, My problem occurred when I retrieved my keystore. I used the wrong path: ~/.android/debug.keystore On Windows, I should of used: keytool -exportcert -alias androiddebugkey -keystore C:/Users/Administrator/.android/debug.keystore | openssl sha1 -binary | openssl base64 It'll ask for the password, which is "android". The code that comes out can be registered into Amazon's Whitelist and the game runs fine on my Kindle Fire.
10 |5000 characters needed characters left characters exceeded

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

StephenC@Amazon avatar image
StephenC@Amazon answered
Thanks for following up with your solution. I'm sure other devs will benefit!
10 |5000 characters needed characters left characters exceeded

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