[GPGS] Error 8: INTERNAL_ERROR on login

Hi,

While I’m really excited to use the new GPGS plugin I can’t get it to log into the service.

I double and tripple checked all the SHA1, build.settings, config.lua, Developer Console etc. – everything appears to be fine. I’m using the latest daily build of Corona. Also the login works perfectly when I replace the new plugin with the legacy one in the same app.

With the new GPGS though, an attempt to login results in error code 8 and errorMessage: internal error.

Here’s the function I’m using for handling the plugin:

function onGpgs(e) if e.name == "init" and e.isError == false then logToScreen("GPGS initialized succesfully. Trying to log in.") gpgs.enableDebug() gpgs.login( {userInitiated = true, listener = onGpgs} ) elseif e.name == "init" and e.isError == true then logToScreen("Error initializing GPGS.") elseif e.name == "login" and e.isError == false and e.phase == "logged in" then logToScreen("Login function returned LOGGED IN.") logToScreen("gonna try to get account name") gpgs.getAccountName( onGpgs ) elseif e.name == "login" and e.isError == true then logToScreen("Error logging in.") logToScreen("Error message: " .. e.errorMessage) logToScreen("Error code: " .. e.errorCode) gpgs.getAccountName( onGpgs ) elseif e.name == "getAccountName" and e.isError == false then logToScreen("Account name: " .. e.accountName) end end logToScreen("Gonna try to log into google play.") gpgs.init( onGpgs )

The app outputs this (the logToScreen function just displays messages on-screen):

9uasjn.jpg

Not much more can be learned from logcat:

357f5zn.png

Do you have any idea why doesn’t it work?

I got exactly the same problem :frowning:

I had this issue before and the problem was I hadn’t created at least 5 achievements.

Legacy plugin uses an outdated GPGS SDK version, it could be more permissive than the newer one.
Is your Game Services app a newly created one or is it something that is already used for some time? E.g. with real users data?

In my case its a newly created one, however Im not new to getting GPGS working and from what I can see everything is set up as it should be.

irob.culley, if you have other already published GPGS apps, can you please try connecting to them?

Will do, might be a few days though. My wife says its the weekend and Im not supposed to work…

Okay, thanks for the suggestions. I have a couple of already-working apps so I will try to connect them to the new gpgs. 

This was also my conclusion that the legacy plugin is probably more permissive in certain respects. I’ll also verify if I have the achievements in place and report.

EDIT:

I didn’t have the 5 achievements in place, but the status of the app said “Ready for testing”. After adding the achievements the error is still there. Will try connecting an existing app.

I connected an existing app that I have online with working achievements etc. (the existing game that uses it uses the legacy plugin). Still nothing: Error 8.

I’m running out of things on the checklist:

  • the app is linked with the correct package name and SHA1 codes (both release and debug) [OK]

  • the Console app is published and online                  [OK]

  • the same parameters work with the legacy plugin [OK]

  • 5 achievements are in place                                  [OK]

  • the app ID is set correctly in build.settings              [OK]

  • the license is set correctly in config.lua  [OK]

  • Google Drive API enabled in the Console  [NO??]

Here’s my build.settings file, maybe I have something misconfigured there?

settings = { plugins = { ["plugin.utf8"] = { publisherId = "com.coronalabs" }, ["plugin.gpgs"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, }, orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "portrait", supported = { "portrait", }, }, excludeFiles = { -- Include only the necessary icon files on each platform iphone = { "Icon-\*dpi.png", }, android = { "Icon.png", "Icon-Small-\*.png", "Icon\*@2x.png", }, }, -- -- iOS Section -- iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend CFBundleIconFiles = { [the standard icons entries, removed here to shorten code] }, }, }, -- -- Android Section -- android = { usesPermissions = { "android.permission.INTERNET", "com.android.vending.BILLING", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.GET\_ACCOUNTS" }, googlePlayGamesAppId = "14XXXXXXXXXX", \<-- the Id of my app }, }

pirx, when you mention SHA1, do you mean google license key in config.lua? It should be not a SHA1 key, but a value that you get on " Services & APIs" page of your app on Google Play Developer Console.

@Lerg No, I meant when you link the app in the Developer Console it asks for the package name and the SHA1 code generated from the release/debug.keystore file. 

I think I have the license in config.lua set correctly but I will go and check that carefully.

I have the same problem as well. legacy gamenetwork works as expected but new gpgs gives internal error 8 on login

I fixed the problem at last. After enabled Drive API and Google Play Developer API for the project in developer console, it worked all of sudden.

weshwf, glad to hear it!
Can you please elaborate on why you had to use console.developers.google.com? It doesn’t seem to be required.

Thanks!

@weshw - You’re a genius, I did that and now it works. In my case I also enabled the “Google Play Game Services” API.

@Lerg No idea why. As can be seen in the above thread though, it was not going to work until an API was enabled in console.developers.google.com. Everything else was set correctly. I’m not sure which one of the APIs was required but when I have some free time (perhaps later today) I’ll try disabling them one by one and seeing what happens.

Thanks mate. In my case Google Play service API was enabled at the very beginning, I was thinking it is all I need from all documents I ever read.

Since adb logcat with coronalabs filter did not produce useful hint, I decided to go through the whole log. I spotted error messages about Drive API. I don’t know why Drive API is required. To give it a chance I enabled it in console, console logs shows multiple errors with times before I enabled the API, kinda dodgy.

I’m not sure is Google play game service depends on Drive or coronalabs’s implementation making Drive API calls.

The errors gone, but gpgs was still not working. I realized I was using a developer account to test, the google play developer API “hints” like it is required if using developer account for google play , and bingo it works after I enabled it

I’m not dare to disable Drive API to test is it really needed. Don’t wanna take chance to break a working situation :slight_smile:

weshwf, Drive API is what Snapshots use internally.
How you end up on that console site? If you create a new Google Play Games Services app, it won’t be listed there.

I thought it is pretty obvious, after I created my google play game service , at the bottom of the page is showing :

The following APIs need to be turned on in the API console project for Games services to work:

 

APIs required for basic Games Services to work

Google Play Game Services and Google Play Game Management

That’s it. that’s why I wonder, why if Drive API is required by the snapshot feature of google play game services, the google developer console page does not say so or at least suggest that.

I just follow the link, go to API console, create a new project there, and link my google play game services to it.

weshwf, do you use the main developer account for setting up Google Play Games Services or a secondary (that can be invited into the Developer Console)?

I’m using my main account