I’m trying to implement google play game services for my game but the log-in keeps failing.
Logcat:
APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES
This is usually caused by one of these reasons:
(1) Your package name and certificate fingerprint do not match
the client ID you registered in Developer Console.
(2) Your App ID was incorrectly entered.
(3) Your game settings have not been published and you are
trying to log in with an account that is not listed as
a test account.
To help you debug, here is the information about this app
Package name :
Cert SHA1 fingerprint:
App ID from manifest : My App ID
Check that the above information matches your setup in
Developer Console. Also, check that you're logging in with the
right account (it should be listed in the Testers section if
your project is not yet published)
build.settings:
android =
{
usesPermissions =
{
"android.permission.INTERNET",
"com.android.vending.CHECK_LICENSE",
},
googlePlayGamesAppId = "App ID",
},
plugins =
{
["plugin.gpgs.v2"] =
{
publisherId = "com.coronalabs",
supportedPlatforms = { android=true }
},
config.lua
license =
{
google =
{
key = "license key",
policy = "serverManaged"
},
},
leaderboards.lua
local globalData = require( "globalData" )
local json = require( "json" )
globalData.gpgs = nil
globalData.gameCenter = nil
local platform = system.getInfo( "platform" )
local env = system.getInfo( "environment" )
if ( platform == "android" and env ~= "simulator" ) then
globalData.gpgs = require( "plugin.gpgs.v2" )
end
local function gpgsInitListener( event )
if not event.isError then
if ( event.name == "login" ) then -- Successful login event
print( json.prettify(event) )
end
else
display.newText(layers.content, "error", centerX, centerY, "OpenSans-Regular.ttf", 18)
end
end
-- Apple Game Center initialization/login listener
local function gcInitListener( event )
if event.data then -- Successful login event
print( json.prettify(event) )
end
end
if ( globalData.gpgs ) then
-- Initialize Google Play Games Services
globalData.gpgs.login( { userInitiated=true, listener=gpgsInitListener } )
elseif ( globalData.gameCenter ) then
-- Initialize Apple Game Center
globalData.gameCenter.init( "gamecenter", gcInitListener )
end
The license key is copy pasted from the Google Play console, app ID as well and it matches the ID in the log, SHA1 certificate is also correct, app is published for alpha testing, Google play services are published. What could possibly be the problem?
Also what do they mean by client ID? Do they mean the OAuth2 Client ID?