When a user creates a match game via Google Play Game Services and then start the game before an opponent joins the game, it crashes the app with java.lang.IllgalStateException runtime error. I’d like to know how we may prevent this from happening.
Here’s how to reproduce this error:
-
Create a match game, which brings up GPGS screen (a generic screen that comes up for any GPGS multiplayer games.)
-
On this screen, pick Auto-pick player and tap on “Play”.
-
Screen changes to “Waiting for auto-match” screen (another generic screen that comes up for any GPGS multiplayer games.)
-
On this waiting screen, there is a drop down menu on upper right corner (with three dots), which provides “Start playing” and “Leave room” option. If I can hide “Start playing” option, it would prevent this error from happening all together. However, if I can’t hide it and if the “Start playing” is tapped while waiting for an opponent to join the game, app crashes with the runtime error: java.lang.IllgalStateException: Not connected. Call connect() and wait for onConnected() to be called.
As far as I am aware, this GPGS screen is beyond my control. And if so, are all GPGS multiplayer games doomed to crash like this when they are built with Corona SDK? If I am mistaken, and Corona SDK built apps can handle this without causing any runtime errors, I’d so like to know how. Please help!
Naomi