GPGS Login getting 403 response

I have created a simple page to test gpgs.init and gpgs.login and when I look at the log file when the login is called I am getting a 403, and when I look at the project # shown in the log it doesn’t match my “googlePlayGamesAppId”.  On the Google Play Developer Console everything has a green checkmark.

part of my build.settings file is below (My app id is mostly hidden):

 plugins = { ["plugin.gpgs"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, }, android = { googlePlayGamesAppId = "XXXXXXXX1703", versionCode = "11",

Code from my testScene.lua:

local function gpgsLoginCallback(event) logger:debug("gpgsLoginCallback()"); logger:debug(event); end local function gpgsInitCallback(event) logger:debug("gpgsInitCallback()"); logger:debug(event); gpgs.login{ userInitiated=true, listener=gpgsLoginCallback }; end local function handleButtonEvent(event) logger:debug( "handleButtonEvent()" ); if ( "ended" == event.phase ) then logger:info("Button pressed"); --gpgs.init( ); gpgs.init( gpgsInitCallback ); end end

Log file excerpt (note the reference to project 608941808256, which is not my project at all):

09-14 22:00:07.912 23169 24309 W GamesServiceBroker: Client connected with SDK 8487000, Services 9680436, and Games 37240036 09-14 22:00:08.050 23169 23829 E Volley : [4996] BasicNetwork.performRequest: Unexpected response code 403 for https://www.googleapis.com/games/v1/players/me?language=en\_US 09-14 22:00:08.118 23169 31963 E SignInIntentService: Access Not Configured. Google Play Game Services API has not been used in project 608941808256 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/games/overview?project=608941808256 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. 09-14 22:00:08.118 23169 31963 E SignInIntentService: com.google.android.gms.games.server.error.GamesException 09-14 22:00:08.118 23169 31963 E SignInIntentService: at com.google.android.gms.games.server.GamesServer.getResponseBlocking(GamesServer.java:174) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at com.google.android.gms.games.server.api.PlayersApi.getBlocking(PlayersApi.java:86) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at com.google.android.gms.games.broker.PlayerAgent.getPlayerFromNetwork(PlayerAgent.java:1638) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at com.google.android.gms.games.broker.PlayerAgent.fetchPlayer(PlayerAgent.java:633) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at com.google.android.gms.games.broker.DataBroker.loadSelf(DataBroker.java:1048) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at com.google.android.gms.games.service.PlayGamesSignInIntentService$LoadSelfOperation.executeInternal(PlayGamesSignInIntentService.java:294) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at com.google.android.gms.games.service.PlayGamesSignInIntentService$BaseOperation.execute(PlayGamesSignInIntentService.java:56) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at com.google.android.gms.games.service.PlayGamesSignInIntentService$OperationAdapter.execute(PlayGamesSignInIntentService.java:520) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at com.google.android.gms.chimera.BaseAsyncOperationService$OperationTask.run(BaseAsyncOperationService.java:177) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at com.google.android.gms.common.util.concurrent.PriorityRunnable.run(PriorityRunnable.java:17) 09-14 22:00:08.118 23169 31963 E SignInIntentService: at java.lang.Thread.run(Thread.java:818) 09-14 22:00:08.124 31903 31903 E LoadSelfFragment: Unable to sign in - application does not have a registered client ID 09-14 22:00:08.125 31903 31903 I SignInActivity: Transition from 8 to 11 09-14 22:00:08.125 31903 31903 W SignInActivity: onSignInFailed()... 09-14 22:00:08.125 31903 31903 W SignInActivity: Sign in failed during 8 09-14 22:00:08.125 31903 31903 W SignInActivity: ==\> Returning non-OK result: 10004 09-14 22:00:08.127 31903 31903 W PopupManager: You have not specified a View to use as content view for popups. Falling back to the Activity content view. Note that this may not work as expected in multi-screen environments 09-14 22:00:08.188 23169 24309 W GamesServiceBroker: Client connected with SDK 8487000, Services 9680436, and Games 37240036 09-14 22:00:08.197 31819 31819 W plugin.gpgs: This application is misconfigured.

Any insight would be appreciated.

Can you post your config.lua as well?

Please find my config.lua below:

--calculate the aspect ratio of the device local aspectRatio = display.pixelHeight / display.pixelWidth; application = { content = { width = aspectRatio \> 1.5 and 800 or math.ceil( 1200 / aspectRatio ), height = aspectRatio \< 1.5 and 1200 or math.ceil( 800 \* aspectRatio ), scale = "letterBox", fps = 60, imageSuffix = { ["@2x"] = 1.3, }, }, };

emaxham, hi. You need to add google’s license key in config.lua. Also make sure you are using a proper keystore when building.

That appears to have fixed my problem…  I must have missed that step.  Thanks for the help guys!

Can you post your config.lua as well?

Please find my config.lua below:

--calculate the aspect ratio of the device local aspectRatio = display.pixelHeight / display.pixelWidth; application = { content = { width = aspectRatio \> 1.5 and 800 or math.ceil( 1200 / aspectRatio ), height = aspectRatio \< 1.5 and 1200 or math.ceil( 800 \* aspectRatio ), scale = "letterBox", fps = 60, imageSuffix = { ["@2x"] = 1.3, }, }, };

emaxham, hi. You need to add google’s license key in config.lua. Also make sure you are using a proper keystore when building.

That appears to have fixed my problem…  I must have missed that step.  Thanks for the help guys!