GPGS leaderboards are not showing

Just published yesterday! Hot off the press: https://docs.coronalabs.com/tutorial/games/gameLeaderboards/index.html

Rob

We followed the tutorial, which Rob just posted. But the leaderboards still don`t show. We run the adb logcat and we got this message:

ConfigFileUtils: Failed to read config file: /data/data/com.google.android.gms/app_chimera/current_modulesets.pb: open failed: ENOENT (No such file or directory)

Here is our main.lua:

local composer = require( "composer" ) display.setStatusBar( display.HiddenStatusBar ) native.setProperty( "androidSystemUiVisibility", "immersive" ) -- Code to initialize your app local loadsave = require("loadsave") local licensing = require( "licensing" )licensing.init( "google" ) local function licensingListener( event ) if not ( event.isVerified ) then -- Failed to verify app from the Google Play store; print a message local function onComplete( event ) if ( event.action == "clicked" ) then local i = event.index if ( i == 1 ) then -- Do nothing; dialog will simply dismiss native.requestExit() end end end native.showAlert( "Error:", "Please download this app from Google Play", { "OK" }, onComplete ) end end licensing.verify( licensingListener ) --muista build.settings!!!!!!!!!!!!!! -- Assumes that "scene1.lua" exists and is configured as a Composer scene local gpgs = require( "plugin.gpgs" ) local gpgsData local json = require( "json" ) gpgsData = loadsave.loadTable( "gpgsData.json" ) if ( gpgsData == nil ) then gpgsData = {} gpgsData.firstTime = true loadsave.saveTable( gpgsData, "gpgsData.json" ) end -- gpgsData nil conditional END local function gpgsInitListener( event ) if not event.isError then if ( event.name == "init" ) then -- Initialization event -- Attempt to log in the user if (gpgsData.firstTime == true) then gpgs.login( { userInitiated=true, listener=gpgsInitListener } ) gpgsData.firstTime = false loadsave.saveTable( gpgsData, "gpgsData.json" ) else gpgs.login( { listener=gpgsInitListener } ) end elseif ( event.name == "login" ) then -- Successful login event print( json.prettify(event) ) end end end gpgs.init( gpgsInitListener ) composer.gotoScene( "menu" )

here is our menu.lua where the leaderboards should show:

if ( phase == "will" ) then -- Code here runs when the scene is still off screen (but is about to come on screen) local widget = require( "widget" ) local gpgs = require( "plugin.gpgs" ) local loadsave = require("loadsave") local json = require( "json" ) local gpgsData local function submitScoreListener( event ) -- Google Play Games Services score submission if not event.isError then local isBest = nil if ( event.scores["daily"].isNewBest ) then isBest = "a daily" elseif ( event.scores["weekly"].isNewBest ) then isBest = "a weekly" elseif ( event.scores["all time"].isNewBest ) then isBest = "an all time" end if isBest then -- Congratulate player on a high score local message = "You set " .. isBest .. " high score!" native.showAlert( "Congratulations", message, { "OK" } ) print("moi") else -- Encourage the player to do better native.showAlert( "Sorry...", "Better luck next time!", { "OK" } ) end end end local function submitScore( score ) -- Submit a score to Google Play Games Services gpgs.leaderboards.submit( { leaderboardId = "CgkI5bWMz4wFEAIQAQ", score = score, listener = submitScoreListener }) end submitScore(10) local function showLeaderboards(event) if event.phase == "ended" then gpgs.leaderboards.show("CgkI5bWMz4wFEAIQAQ") end end local function gotoBuild(event) if event.phase == "ended" then end end local menuText = display.newText("MENU", display.contentCenterX, display.contentCenterY- 120, native.systemFrontBold, 50) local playButton = widget.newButton( { left = display.viewableContentWidth/2 - 80, top = display.viewableContentHeight/2 - 90, width = 160, height = 100, defaultFile = "images/buttons/Reset.png", onEvent = showLeaderboards } ) local buildButton = widget.newButton( { left = display.viewableContentWidth/2 - 80, top = display.viewableContentHeight/2 + 20, width = 160, height = 100, defaultFile = "images/buttons/Reset.png", onEvent = gotoBuild } ) elseif ( phase == "did" ) then -- Code here runs when the scene is entirely on screen end

Are you running “adb logcat” with any additional parameters?

No, so I saw the google messages also.

Are you 100% sure the user is logged in by the time you try to submit a score? Are you getting such confirmation from your “gpgsInitListener()” function"?

Brent

Hi! we may have found the error:

 07-29 11:14:13.628 23650 23694 I LicenseChecker: Received response. 07-29 11:14:13.628 23650 23694 I LicenseChecker: Clearing timeout. 07-29 11:14:13.658 4899 5471 W Auth : [GetToken] GetToken failed with status code: UNREGISTERED\_ON\_API\_CONSOLE 07-29 11:14:13.660 12705 13131 E TokenRequestor: You have wrong OAuth2 related configurations, please check. Detailed error: UNREGISTERED\_ON\_API\_CONSOLE 07-29 11:14:13.669 12705 13281 W GamesServiceBroker: Client connected with SDK 11411000, Services 11302448, and Games 52250048

this is from the adb logcat.

The problem is solved! The problem was with the oAuth client and enabled APIs. Thanks for your help!