Result code sent back to the calling Activity when signing in fails. The attempt to sign in to the Games service failed. For example, this might happen if the network is flaky, or the user's account has been disabled, or consent could not be obtained. Constant Value: 10002
Can you share the related parts of code from build.settings and your code so we can have a sense of what’s going on? Don’t forget to replace your IDs with fake ones.
license = { google = { -- The "key" value is obtained from Google key = "Key from Play Developer Console", -- The "policy" key is optional; its value can be either "serverManaged" (default) or "strict" -- A value of "serverManaged" will query the Google server and cache the results (this is similar to Google's "ServerManagedPolicy") -- A value of "strict" will not cache the results, so when there's a network failure, the licensing will fail (this is similar to Google's "StrictPolicy") policy = "serverManaged" }, },
main.lua
local function gpgsInitListener(event) print("GPGS init: " .. event.name) if event.isError then -- Failed to verify app from the Google Play store; print a message print("GPGS init error message: " .. event.errorMessage) print("GPGS init error code: " .. event.errorCode) else print("GPGS init succeeded") end end gpgs.init(gpgsInitListener)
login code
local function loginListener(event) if event.isError then -- Failed to login to Google print("GPGS login error message: " .. event.errorMessage) print("GPGS login error code: " .. event.errorCode) else print("Successfully logged in to Google") showLoginButton(false) end end gpgs.login({userInitiated = true, listener = loginListener})
Can you share the related parts of code from build.settings and your code so we can have a sense of what’s going on? Don’t forget to replace your IDs with fake ones.
license = { google = { -- The "key" value is obtained from Google key = "Key from Play Developer Console", -- The "policy" key is optional; its value can be either "serverManaged" (default) or "strict" -- A value of "serverManaged" will query the Google server and cache the results (this is similar to Google's "ServerManagedPolicy") -- A value of "strict" will not cache the results, so when there's a network failure, the licensing will fail (this is similar to Google's "StrictPolicy") policy = "serverManaged" }, },
main.lua
local function gpgsInitListener(event) print("GPGS init: " .. event.name) if event.isError then -- Failed to verify app from the Google Play store; print a message print("GPGS init error message: " .. event.errorMessage) print("GPGS init error code: " .. event.errorCode) else print("GPGS init succeeded") end end gpgs.init(gpgsInitListener)
login code
local function loginListener(event) if event.isError then -- Failed to login to Google print("GPGS login error message: " .. event.errorMessage) print("GPGS login error code: " .. event.errorCode) else print("Successfully logged in to Google") showLoginButton(false) end end gpgs.login({userInitiated = true, listener = loginListener})
I cannot get the login to succeed. I have tried enabling all the required google apis and following the tutorials. No matter what I do, it always returns “sign in failed” on the login. I don’t know what else to do at this point.
Can you tether your device to your computer and use “adb logcat” to capture the console log while you urn your app. Please don’t add any filters. This will produce large log file full of irrelevant items, but we need to see messages from multiple activities/processes.
Also please post your code you’re using to login with.
I cannot get the login to succeed. I have tried enabling all the required google apis and following the tutorials. No matter what I do, it always returns “sign in failed” on the login. I don’t know what else to do at this point.