Not connected GPGS v2

I published the leaderboard but it still fails. I guess I’ll try a different solution.

Administrative note: Please don’t quote whole messages when they are particularly long or has images.

Thanks

Rob

Sorry that I forgot to mention some details.

1- APIs required part doesn’t show me to enable Drive API but I enabled it anyway. Even though it’s enabled and not required for simple login to work, I still get errors for Drive API on the console. I’m assuming pinging Drive API is a plugin thing but I’m not sure if it’s related to the problem we’re having.

2- I’m not sure if it’s a Google thing or a plugin thing but we shouldn’t be seeing the “logged in” phase when GPGS is not connected nor authenticated. We should be seeing a “login fail” state or an event error with an error message to why it failed but the event returns no errors with a “logged in” flag even though we’re not.

I’ve been restarting from scratch a few times now setting up the game in the play console and so on. Still no success, is it possible to use the old plugin gpgs (v1)? When I try to use the old plugin the game crashes on launch unfortunately.

I really need to get this update pushed soon if possible  :slight_smile:

You can try and use the old plugin, but it’s dependent on the Google Plus login scope.

Rob

No Rob, i’m afraid old plugin is not working, it always receives “8 internal error” even though i’m using same code than other game which is working with old plugin, that was my reason to move to gpgs.v2 plugin but also i’m receiving a gpgs.v2 “not connected” in adb.

Days and days debugging and trying workarounds and there is no way of use gpgs on a game, maybe because it doesn’t depend on us… but it’s awful.

Me too, could this be the reason of “not connected” error?

For all you to know, i removed my linked app from the game services that i was trying to connect and i have linked it to a game in my game services that i was using (and working) and just changing the googlePlayGamesAppId in my build settings … it works (with gpgs v1). 

I did the same change as gorosoft above and it worked for me too. Using gpgs.v2 in my case.

But unfortunately this can not be considered as a permanent solution.

Now that the leaderboard does open, but it gives you the choice to open all the leaderboards of the other linked games.

So if i have 10 linked games and use this method to finally get the leaderboards working, I will end up with a player who wants to check his standing but instead gets frustrated from having to find the right board from the list.

It will be confusing and ultimately cause the player to see it as a disturbance.

In general I am very dissapointed.

I have 6 android studio apps all working fine.

2 unity apps working fine as well.

I only face this issue with corona and no matter what I do there is no solution, since it doesn’t seem to be a problem with corona.

I hope someone comes up with an idea before I give it up because I am very close to that point.

I already gave up and trying some php/mySQL solution to setup my own leaderboard at the moment because it seems that Corona doesn’t have any plans to look into this in the near future. That’s what I got from Rob’s answers above. I’d advice you follow the same route.

By the way, I don’t think GPGS v1 can be considered a reliable solution because, as far as I can remember, people were reporting many ANRs and crashes related to that version.

That’s not quite 100% correct. I’m trying to build a fresh app that uses the GPGSv2 plugin to see if I can find the trigger as to why some apps work and others do not.

Now that said, I believe GPGS has a REST API and if you’re just wanting leaderboards, it might be a simpler approach. But I am trying to track down the difference.

Rob

@Rob

I am getting some errors in isAuthenticated() method of gpgs v2. Here is the linkto the full error report. This error happen when in the user is logged out and any gpgs calls gives runtime error.  :frowning:

Yes, same for me, now i have 2 leatherboards… and also, good to know that android studio and unity apps are working fine, maybe it’s time to try unity and leave corona apart for a while till this issue is solved.

@bgmadclown, thank you for the info about GPGS v1 and ARN and crashes.

Rob, I think that you won’t be able to make it work as long as you use a NEW game services play, if you do, it would be great, but it is not only about leaderboards but also about realtime multiplayer, at least in my case.

I’m really hoping that you find out why we are getting “not connected” from gpgs

Hello.

Im having the same issues with gpgs version 2.

How do we manually activate Drive API and Google Play Developer API?

Here is the test code I used with the developer of the GPGS v2 plugin to test snapshots. It’s geared to the way I do things with a faux global table and my internals, so you can’t just copy/paste this code. You will need to modify it to your use:

local myTable = { play = 1 } local snapshotFilename = "snapshot1" local data = json.encode( myTable ) local function gpgsSnapshotOpenForReadListener( event ) print( "snapshot open event:", json.prettify(event) ) if not event.isError then local data = event.snapshot.contents.read() native.showAlert('Snapshots', 'Reading was ' .. (event.isError and 'unsuccessful' or 'successful') .. ',', { 'OK'}) end end local function gpgsSnapshotAfterSaveListener( event ) native.showAlert('Snapshots', 'Saving was ' .. (event.isError and 'unsuccessful' or 'successful') .. '.', {'OK'}) end function myData.openSnapshot() print("Opening snapshot") myData.gpgs.snapshots.open({ filename = snapshotFilename, listener = gpgsSnapshotOpenForReadListener }) end local function gpgsSnapshotOpenForSaveListener( event ) print("open for save listener", json.prettify( event )) if not event.isError then event.snapshot.contents.write(data) -- Write new data as a JSON string into the snapshot myData.gpgs.snapshots.save({ snapshot = event.snapshot, description = 'Save slot ' .. snapshotFilename, listener = gpgsSnapshotAfterSaveListener }) end end function myData.saveSnapshot() print("saving snapshhot") myData.gpgs.snapshots.open({ -- Open the save slot filename = snapshotFilename, create = true, -- Create the snapshot if it's not found listener = gpgsSnapshotOpenForSaveListener }) end

if myData.gpgs then

print(“Initializing GPGS”)

–myData.gpgs.init( gpgsInitListener )

myData.gpgs.login( { userInitiated=true, listener=gpgsLoginListener } )

end

It looks like I’ve deleted the code to actually call these functions, but it should be pretty obvious how to use them.

Hello Rob!

My main problem is that I can’t even connect using gpgs v2.

My apps are working fine with version 1 for years.

APIs have green marks as you said and everything works fine with version 1.

Also my code is exactly the same as yours.

Some help please!

edit:

Should I update the OAuth 2.0 protocol manually?

On March 7 gpgs version 1 will stop working because of Google+ APIs shutting down.

There is an issue with gpgs version 2 reported months ago from many developers (myself included).

No popup login and snapshots for saving / loading not working.

You are going to leave us without key features in our existing apps.

It was reported that Unity and Android Studio apps has no problem with this change.

It is just Corona.

Rob is alone here. Shouldn’t more Corona stuff post something and try to help us?

Edit:

I’m not using App Signing from Google Play.

What kind of updates should be done (for apps already live in store long ago) in:

play.google.com/apps/publish

and

console.developers.google.com/

??

I have working login and snapshots although login popup doesn’t appear.

Maybe that’s the way it works now for already installed apps?

Posts about APIs and Rob’s code were very helpful and the final touch for me was this:

local data = gpgs.snapshots.getSnapshot (event.snapshotId) -- instead of -- local data = event.snapshot.contents.read()

Thank you :slight_smile:

I don’t believe you will get a login prompt once you have successfully logged in.

Rob