Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

GPGS - ERROR: Table's property 'leaderboardId' is not a string
Started by joeversh Sep 04 2018 07:50 PM

8 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

joeversh

[GLOBAL: userInfoPane.html]
joeversh
  • Observer

  • 24 posts
  • Corona SDK

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

 



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,163 posts
  • Corona SDK

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



[TOPIC: post.html]
#3

joeversh

[GLOBAL: userInfoPane.html]
joeversh
  • Observer

  • 24 posts
  • Corona SDK

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


[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,163 posts
  • Corona SDK

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

 

Rob



[TOPIC: post.html]
#5

cbriggsnz

[GLOBAL: userInfoPane.html]
cbriggsnz
  • Contributor

  • 283 posts
  • Corona SDK

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.

 

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

 

Corona 3380

Samsung s7

Android v8

Macbook pro 10.13.6

 

Cheers,

 

Craig



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,163 posts
  • Corona SDK

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

[TOPIC: post.html]
#7

Dev-Ze.rocks

[GLOBAL: userInfoPane.html]
Dev-Ze.rocks
  • Contributor

  • 210 posts
  • Corona SDK

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



[TOPIC: post.html]
#8

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,163 posts
  • Corona SDK

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



[TOPIC: post.html]
#9

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,163 posts
  • Corona SDK

I'll get the docs updated.




[topic_controls]
[/topic_controls]