Hi,
I think this is not a new problem and it was reported on below forum thread too.
https://forums.coronalabs.com/topic/38108-google-play-game-services-crash-app/
In my game, I have a button, called gamePlayButton, that load login screen or show leaderboard depending on if the user is already login or not. These are the steps to reproduce problem:
-
touch the gamePlayButton to show login
-
login
-
touch the button again to show leaderboard
-
touch the leaderboard sign to load leaderboard screen
-
touch on the menu at the upper right corner (three dots)
-
settings
-
sign out
After signing out, the GPGS doesn’t close itself and if you touch on the leaderboard sign again, it will crash. We can touch the arrow at the upper left corner to close it (in this case, no crash)
- In both cases above (crash or no crash), touch the gamePlayButton again, the game will crash.
But if I do the following, it will never crash.
-
touch the gamePlayButton to show login
-
login
-
touch on the menu at the upper right corner (three dots)
-
settings
-
sign out
The GSPS close itself and if I touch the gamePlayButton again, it will show the login screen again without any problem. I can repeat this steps and it will never crash.
And this is my code and I’m using build 2646.
main.lua
local gameNetwork = require "gameNetwork" gameNetwork.init("google") local leaderboardId = "XXXXXXX....." gameNetwork.request("login", { userInitiated = false }) local function gameNetworkRequest(event) if event.phase == "ended" then local function loginListener(event1) if event1.isError then --if error else --if no error end end if gameNetwork.request("isConnected") then gameNetwork.show("leaderboards") else gameNetwork.request("login", { userInitiated = true, listener = loginListener }) end end end gamePlayButton:addEventListener("touch", gameNetworkRequest)
build.settings
settings = { orientation = { default = "portrait", supported = { "portrait", "portraitUpsideDown" }, }, android = { usesPermissions = { "android.permission.WRITE\_EXTERNAL\_STORAGE", "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "com.android.vending.CHECK\_LICENSE", "com.android.vending.BILLING", }, googlePlayGamesAppId = "XXXXXXXX...." }, plugins = { ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android = true }, }, }, }
I also test above steps with two other games (one is known to be made with Corona) and the result is the same. So I’m not sure if it is Google or Corona problem. I hope to find solution or at lease a way to handle the crash here.
Thank you.
So Lin