GPGS sign-in not working ("cancelled")

I’m trying to add Google Services to my game and followed the tutorial herebut the sign-in fails. I’ve tried debugging with Android Studio and logcat and noticed that gpgsInitListener throws the following as soon as the login starts:

event.isError: {       isError = true,       name = "login",       phase = "canceled"     }

Funny thing is that I never have the opportunity to choose which account to use (I think other apps show which email is being used and ask to continue). After I access the scene containing the code, I see a “Google Play Games” popup and then a spinning wheel followed by a black screen.

My code is exactly the same as in the tutorial, except for the packageName, appID and leaderboardID. I made sure the app signing is correct as well.

In the logcat I see the following messages:

2019-09-05 21:01:13.404 6603-10712/? W/GamesServiceBroker: Client connected with SDK 18360000, Services 19056039, and Games 110770048 2019-09-05 21:01:13.560 15677-15677/? W/SignInActivity: onSignInFailed()... 2019-09-05 21:01:13.560 15677-15677/? W/SignInActivity: Sign in failed during 6 2019-09-05 21:01:13.560 15677-15677/? W/SignInActivity: ==\> Returning non-OK result: 10002 2019-09-05 21:01:13.589 6603-10712/? W/GamesServiceBroker: Client connected with SDK 18360000, Services 19056039, and Games 110770048

And looking at the doc:

The attempt to sign in to the Games service failed. For example, this might happen if the network is flaky, or the user’s account has been disabled, or consent could not be obtained.

One thing to note is that my app is “pending publication” but I have added my email to the list of testers in the internal test section and it is rolled out.

Update: I’m attaching the full logs. It fails around line 1337.

Note: I’ve replaced my package name with something else in this file.

Both my game and applications are now published (internal test) and the problem remain. I checked the apk fingerprint and it is the correct one…

I realised that it might be an issue with the Google login rather than the corona plugin so I will try to ask on Stackoverflow. Will update this thread if I get any solution.

Any updates on this? I’m having the same problem.

Unfortunately no, try Stackoverflowbut no luck so far…

Turns out, for me, I had missed some steps in the setup.

I followed the tutorial on this page and it solved my problem, maybe this can be helpful for you as well:

http://docs.coronalabs.com/tutorial/games/gameLeaderboards/index.html

I followed this tutorial as well. Did you change anything besides from:

YOUR\_APPLICATION\_ID leaderboardId = "CgkA8kb12jK0onOQBg" globalData.gpgs.leaderboards.show( "CgkA8kb12jK0onOQBg" )

No I didn’t. But my issue was caused because I did not enable the stuff they mention on the Google console thing.

Did you enable Drive API and Google Play Game Services API?

Google Play Developer API was indeed not enabled but even after enabling it I get the same error. Did you have to wait or re-build after enabling the APIs?

No it worked immediately.

I have created a new app in my Google Play Console and rebuilt my app with a new key and it works now.

Not sure what was wrong because I followed the same steps as the tutorial, maybe not in the exact same order this time…

Thanks @TawaNicolas for the help!