Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

[GPGS] Error 8: INTERNAL_ERROR on login
Started by pirx Nov 08 2016 06:57 AM

35 replies to this topic

Best Answer weshwf , 20 November 2016 - 05:47 PM

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.

[TOPIC CONTROLS]
Page 1 of 2 1 2
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

pirx

[GLOBAL: userInfoPane.html]
pirx
  • Enthusiast

  • 68 posts
  • Corona SDK

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?



[TOPIC: post.html]
#2

irob.culley

[GLOBAL: userInfoPane.html]
irob.culley
  • Observer

  • 8 posts
  • Corona SDK

I got exactly the same problem :(



[TOPIC: post.html]
#3

humbertosposito

[GLOBAL: userInfoPane.html]
humbertosposito
  • Observer

  • 8 posts
  • Corona SDK

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



[TOPIC: post.html]
#4

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 453 posts
  • Corona Staff

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?



[TOPIC: post.html]
#5

irob.culley

[GLOBAL: userInfoPane.html]
irob.culley
  • Observer

  • 8 posts
  • Corona SDK

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.



[TOPIC: post.html]
#6

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 453 posts
  • Corona Staff

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



[TOPIC: post.html]
#7

irob.culley

[GLOBAL: userInfoPane.html]
irob.culley
  • Observer

  • 8 posts
  • Corona SDK

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



[TOPIC: post.html]
#8

pirx

[GLOBAL: userInfoPane.html]
pirx
  • Enthusiast

  • 68 posts
  • Corona SDK

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.



[TOPIC: post.html]
#9

pirx

[GLOBAL: userInfoPane.html]
pirx
  • Enthusiast

  • 68 posts
  • Corona SDK

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

	},
}



[TOPIC: post.html]
#10

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 453 posts
  • Corona Staff

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.



[TOPIC: post.html]
#11

pirx

[GLOBAL: userInfoPane.html]
pirx
  • Enthusiast

  • 68 posts
  • Corona SDK

@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.



[TOPIC: post.html]
#12

weshwf

[GLOBAL: userInfoPane.html]
weshwf
  • Observer

  • 11 posts
  • Corona SDK

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



[TOPIC: post.html]
#13

weshwf

[GLOBAL: userInfoPane.html]
weshwf
  • Observer

  • 11 posts
  • Corona SDK

  Best Answer

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.


  • mariona dsr and arnold.gashi like this

[TOPIC: post.html]
#14

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 453 posts
  • Corona Staff

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!



[TOPIC: post.html]
#15

pirx

[GLOBAL: userInfoPane.html]
pirx
  • Enthusiast

  • 68 posts
  • Corona SDK

@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.



[TOPIC: post.html]
#16

weshwf

[GLOBAL: userInfoPane.html]
weshwf
  • Observer

  • 11 posts
  • Corona SDK

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

 

 

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 :-)



[TOPIC: post.html]
#17

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 453 posts
  • Corona Staff

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.



[TOPIC: post.html]
#18

weshwf

[GLOBAL: userInfoPane.html]
weshwf
  • Observer

  • 11 posts
  • Corona SDK

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.



[TOPIC: post.html]
#19

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 453 posts
  • Corona Staff

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)?



[TOPIC: post.html]
#20

weshwf

[GLOBAL: userInfoPane.html]
weshwf
  • Observer

  • 11 posts
  • Corona SDK

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



[TOPIC: post.html]
#21

gyip

[GLOBAL: userInfoPane.html]
gyip
  • Observer

  • 2 posts
  • Corona SDK

Thanks guys, for my case, Google Play Game Service and Google Play Game Management were enabled when I enable Google Play Game Service.  So I have to enable Drive API manually.  Thanks!



[TOPIC: post.html]
#22

wilsonwansun

[GLOBAL: userInfoPane.html]
wilsonwansun
  • Enthusiast

  • 57 posts
  • Corona SDK

Thanks guys, I've tried one whole day in order to solve this error 8 problem, before I found this link.

 

@Lerg you have to specify this for your updated doc.

 

enable Drive API manually

at -->  https://console.developers.google.com



[TOPIC: post.html]
#23

dylestorm

[GLOBAL: userInfoPane.html]
dylestorm
  • Enthusiast

  • 55 posts
  • Corona SDK

Sorry to bump an old topic but many many thanks for @weshwf for his solution. I was at wits end trying to get the Android leaderboard and achievements to work under the new GPGS plugin. After I enabled Drive API and Google Play Developers API, they both finally worked.

 

I second the motion of having this added into the GPGS documentations, at the very least some kind of a note to let devs know that this is a possible fix. 

 

Cheers  :)


  • cmontesino likes this

[TOPIC: post.html]
#24

pirx

[GLOBAL: userInfoPane.html]
pirx
  • Enthusiast

  • 68 posts
  • Corona SDK

having this added into the GPGS documentations, at the very least some kind of a note to let devs know that this is a possible fix. 

 

That's an excellent idea. Should be part of the standard implementation checklist for GPGS and surely it will be soon.

 

As a side note, this issue results from the error handling on Google's part. Returning "Internal error" doesn't say anything about what's wrong. It should definitely be more specific. It's like the Corona simulator just said "there's an error somewhere in your code" without giving any specifics.



[TOPIC: post.html]
#25

rune7

[GLOBAL: userInfoPane.html]
rune7
  • Contributor

  • 306 posts
  • Corona SDK

Got into the same issue when transferring from the old system to the new GPGS plug-in. Should have been detailed in the docs. too much overhead and time lost with no leads just to rebuild under the new system.




[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]