question

dingetje61 avatar image
dingetje61 asked

Shutdown bug in AmazonGamesClient

I have implemented Amazon GameCircle SDK in my game. It works "most of the time" although I too see problems with logging in to the service as many others are reporting here. But now it looks like I've found a bug in the AmazonGamesClient itself: java.lang.NullPointerException at com.amazon.ags.api.AmazonGamesClient.shutdown_internal(AmazonGamesClient.java:569) at com.amazon.ags.api.AmazonGamesClient.shutdown(AmazonGamesClient.java:552) at nl.amegens.bouncingbabies.BouncingBabyGameActivity.killMe(BouncingBabyGameActivity.java:606) at nl.amegens.bouncingbabies.BouncingBabyGameActivity.showExitAd(BouncingBabyGameActivity.java:649) at nl.amegens.bouncingbabies.MainMenuScene$1$2.onClick(MainMenuScene.java:76) at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4867) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774) at dalvik.system.NativeStart.main(Native Method) A NullPointerException in the shutdown code!
10 |5000

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

dingetje61 avatar image
dingetje61 answered
This crash is the result of this static method: AmazonGamesClient.shutdown(); I've now fixed it by not doing this call when the login has not succeeded, but in all honesty it should not matter if the client is logged in or not, there should never be a NullPointerException no matter what.
10 |5000

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

Pompi avatar image
Pompi answered
Hi, I also implemented GameCircle and was unable to log in. The issue was that when GameCircle activated the browser log in, my app would crash(because of my own bug) and then the log in didn't really work. Maybe your app crash some time when the app enters onPause and that is why it "sometimes" doesn't log in.
10 |5000

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

Jamie Grossman avatar image
Jamie Grossman answered
I would agree with what Pompi said. As game circle suspends your app, you may have not found that there was an initial bug in your code that crashed the app when it went into suspend/resume. Regardless, I could not reproduce the issue myself. 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.