GPGS - ERROR: Table's property 'leaderboardId' is not a string

Hello,

I just did the build of my APP using the 2018.3364 version and to my surprise I got the following error when trying to open the leaderboards: Table’s property ‘leaderboardId’ is not a string. 

By defining this function, the leaderboardId parameter is optional. https://docs.coronalabs.com/plugin/gpgs/leaderboards/show.html

09-05 00:08:39.678 8408 9253 I Corona : com.naef.jnlua.LuaRuntimeException: ERROR: Table's property 'leaderboardId' is not a string. 09-05 00:08:39.678 8408 9253 I Corona : Java Stack Trace: 09-05 00:08:39.678 8408 9253 I Corona : plugin.gpgs.LuaUtils$Table.getStringNotNull(LuaUtils.java:284) 09-05 00:08:39.678 8408 9253 I Corona : plugin.gpgs.Leaderboards.show(Leaderboards.java:218) 09-05 00:08:39.678 8408 9253 I Corona : plugin.gpgs.Leaderboards$4.invoke(Leaderboards.java:55) 09-05 00:08:39.678 8408 9253 I Corona : com.ansca.corona.JavaToNativeShim.nativeTouchEvent(Native Method) 09-05 00:08:39.678 8408 9253 I Corona : com.ansca.corona.JavaToNativeShim.touchEvent(JavaToNativeShim.java:430) 09-05 00:08:39.678 8408 9253 I Corona : com.ansca.corona.input.RaiseTouchEventTask.executeUsing(RaiseTouchEventTask.java:39) 09-05 00:08:39.678 8408 9253 I Corona : com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:170) 09-05 00:08:39.678 8408 9253 I Corona : com.ansca.corona.events.EventManager.sendEvents(EventManager.java:91) 09-05 00:08:39.678 8408 9253 I Corona : com.ansca.corona.Controller.updateRuntimeState(Controller.java:308) 09-05 00:08:39.678 8408 9253 I Corona : com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:425) 09-05 00:08:39.678 8408 9253 I Corona : com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625) 09-05 00:08:39.678 8408 9253 I Corona : com.ansca.corona.graphics.opengl.GLSurfaceView 09-05 00:08:39.679 8408 9253 I Corona : ERROR: Runtime error 09-05 00:08:39.679 8408 9253 I Corona : com.naef.jnlua.LuaRuntimeException: ERROR: Table's property 'leaderboardId' is not a string. 09-05 00:08:39.679 8408 9253 I Corona : Java Stack Trace: 09-05 00:08:39.679 8408 9253 I Corona : plugin.gpgs.LuaUtils$Table.getStringNotNull(LuaUtils.java:284) 09-05 00:08:39.679 8408 9253 I Corona : plugin.gpgs.Leaderboards.show(Leaderboards.java:218) 09-05 00:08:39.679 8408 9253 I Corona : plugin.gpgs.Leaderboards$4.invoke(Leaderboards.java:55) 09-05 00:08:39.679 8408 9253 I Corona : com.ansca.corona.JavaToNativeShim.nativeTouchEvent(Native Method) 09-05 00:08:39.679 8408 9253 I Corona : com.ansca.corona.JavaToNativeShim.touchEvent(JavaToNativeShim.java:430) 09-05 00:08:39.679 8408 9253 I Corona : com.ansca.corona.input.RaiseTouchEventTask.executeUsing(RaiseTouchEventTask.java:39) 09-05 00:08:39.679 8408 9253 I Corona : com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:170) 09-05 00:08:39.679 8408 9253 I Corona : com.ansca.corona.events.EventManager.sendEvents(EventManager.java:91) 09-05 00:08:39.679 8408 9253 I Corona : com.ansca.corona.Controller.updateRuntimeState(Controller.java:308) 09-05 00:08:39.679 8408 9253 I Corona : com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:425) 09-05 00:08:39.679 8408 9253 I Corona : com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625) 09-05 00:08:39.679 8408 9253 I Corona : com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380) 09-05 00:08:39.679 8408 9253 I Corona : stack traceback: 09-05 00:08:39.679 8408 9253 I Corona : [C]: ? 09-05 00:08:39.679 8408 9253 I Corona : [C]: in function 'show' 09-05 00:08:39.679 8408 9253 I Corona : ?: in function '\_onRelease' 09-05 00:08:39.679 8408 9253 I Corona : /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/widget/widgetLibrary/widget\_button.lua:90: in function 'manageButtonTouch' 09-05 00:08:39.679 8408 9253 I Corona : /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/widget/widgetLibrary/widget\_button.lua:658: in function 'method' 09-05 00:08:39.679 8408 9253 I Corona : /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:221: in function \</Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:190\>

[“plugin.gpgs”] = {publisherId = “com.coronalabs”},

gpgs = require( "plugin.gpgs" ) function ReturnShowLeaderboards(event) if event ~= nil then if event.isError ~= nil then if (event.isError) then print(' '..event.errorCode..' - '..event.errorMessage) end return true end end return false end function ShowLeaderboards() if ( system.getInfo("platformName") == "Android" ) then --gameNetwork.show( "leaderboards" ) gpgs.leaderboards.show( {listener=ReturnShowLeaderboards} ) else --gameNetwork.show( "leaderboards", { leaderboard = {timeScope="AllTime"} } ) end return true end

I think you have found a bug. Our docs do say the leaderboardId is optional. Do you need the listener function? Are you planning on doing something special after they come back from showing leaderboards? In most use cases you probably don’t need to do anything, just render your scene in the background and let the leaderboard overlay and just close.

I know it works if you don’t specify a listener.

We are working on the V2 version of the plugin (and I verified the problem is in that plugin as well) and I’ve asked the Engineer to make sure it’s fixed in the V2 version which I hope we will release to the public soon.

In the meantime, if you don’t need the listener, leave it out.

Rob

Hello Rob,

That’s really the problem. I removed the listener and the problem solved.

Thank you!

About version 2, how can I join beta?

Att.,

Jover

@joeversh, it’s not an open beta, but I’ll ask if they would like more testers.

Rob

Hi Rob,

I seem to have the same issue and I have no listener but have included friendsOnly and timeSpan.  For now I can code these out,  but I was trying to make my code as universal as possible.

[lua]

local friendsOnly = params and params.friendsOnly or false

local timeSpan = params and params.timeSpan or “all time”

if ( gpgs ) then

    – Show a Google Play Games Services leaderboard

    if leaderboardId then

    gpgs.leaderboards.show( {leaderboardId = leaderboard, friendsOnly = friendsOnly, timeSpan = timeSpan} )

    else – added a  catch here for testing purposes

    print(“should be loading all leaderboards”, leaderboardId)

    gpgs.leaderboards.show( {friendsOnly = friendsOnly, timeSpan = timeSpan} )

    – gpgs.leaderboards.show(  ) – this works

    print(“done”, leaderboardId)

    end

[/lua]

Corona 3380

Samsung s7

Android v8

Macbook pro 10.13.6

Cheers,

Craig

The presence of any table is triggering the requirement to have a leaderboardId. This has been fixed in the V2 plugin we hope to release soon. We are still investigating the ability to fix it in the V1 plugin. Rob

I just ran into the same problem and spent some time debugging before stumbling upon this thread.

Will this be fixed in the v1 plugin?

If not, please update the documentation.

Best,

Felix

I know our engineer was looking at updating the V1 plugin, but honestly, Google is changing how GPGS logs in and I’m not sure how much time the V1 plugin has left before you have to update to V2 which also has us have to ask how much effort do we put into V1 when you need to be using V2 anyway.

Rob

I’ll get the docs updated.

I think you have found a bug. Our docs do say the leaderboardId is optional. Do you need the listener function? Are you planning on doing something special after they come back from showing leaderboards? In most use cases you probably don’t need to do anything, just render your scene in the background and let the leaderboard overlay and just close.

I know it works if you don’t specify a listener.

We are working on the V2 version of the plugin (and I verified the problem is in that plugin as well) and I’ve asked the Engineer to make sure it’s fixed in the V2 version which I hope we will release to the public soon.

In the meantime, if you don’t need the listener, leave it out.

Rob

Hello Rob,

That’s really the problem. I removed the listener and the problem solved.

Thank you!

About version 2, how can I join beta?

Att.,

Jover

@joeversh, it’s not an open beta, but I’ll ask if they would like more testers.

Rob

Hi Rob,

I seem to have the same issue and I have no listener but have included friendsOnly and timeSpan.  For now I can code these out,  but I was trying to make my code as universal as possible.

[lua]

local friendsOnly = params and params.friendsOnly or false

local timeSpan = params and params.timeSpan or “all time”

if ( gpgs ) then

    – Show a Google Play Games Services leaderboard

    if leaderboardId then

    gpgs.leaderboards.show( {leaderboardId = leaderboard, friendsOnly = friendsOnly, timeSpan = timeSpan} )

    else – added a  catch here for testing purposes

    print(“should be loading all leaderboards”, leaderboardId)

    gpgs.leaderboards.show( {friendsOnly = friendsOnly, timeSpan = timeSpan} )

    – gpgs.leaderboards.show(  ) – this works

    print(“done”, leaderboardId)

    end

[/lua]

Corona 3380

Samsung s7

Android v8

Macbook pro 10.13.6

Cheers,

Craig

The presence of any table is triggering the requirement to have a leaderboardId. This has been fixed in the V2 plugin we hope to release soon. We are still investigating the ability to fix it in the V1 plugin. Rob

I just ran into the same problem and spent some time debugging before stumbling upon this thread.

Will this be fixed in the v1 plugin?

If not, please update the documentation.

Best,

Felix

I know our engineer was looking at updating the V1 plugin, but honestly, Google is changing how GPGS logs in and I’m not sure how much time the V1 plugin has left before you have to update to V2 which also has us have to ask how much effort do we put into V1 when you need to be using V2 anyway.

Rob

I’ll get the docs updated.