MrStahlfelge/gdx-gamesvcs

GPGS Desktop: SEVERE: unable to refresh token, Help?

manutyagi01 opened this issue · 3 comments

Hi I am using you wonderful library and had everything working for a long time until recently I was working on cloud saves.

I got a message in console along the lines of 'two files with the same name found' when calling saveGameState(). I checked using fetchSaveStates() and sure enough there were two files with the same name (which should not happen if I am correct?) Then the desktop version stopped connecting to google play services(mobile version still is working), with the following error messages. Any help if you can understand the reason behind this problem would be very appreciated?

p.s. I tried deleting the save states but this did not help and I tried deleting the old id and creating a new OAuth 2.0 client ID for the desktop version using developer console website and re-downloaded the json file secret key, but this did not seem to help at all....

---This error only appeared once
May 09, 2018 6:26:55 PM com.google.api.client.auth.oauth2.Credential handleResponse SEVERE: unable to refresh token com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request { "error" : "invalid_grant", "error_description" : "Token has been expired or revoked." } at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105) at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287) at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307) at com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:570) at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489) at com.google.api.client.auth.oauth2.Credential.handleResponse(Credential.java:272) at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1015) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469) at de.golfgl.gdxgamesvcs.GpgsClient.waitForUserAuthorization(GpgsClient.java:265) at de.golfgl.gdxgamesvcs.GpgsClient.access$100(GpgsClient.java:67) at de.golfgl.gdxgamesvcs.GpgsClient$2.run(GpgsClient.java:305) at java.lang.Thread.run(Thread.java:748)

---This error occurs every time now when trying to connect the desktop version
gsShowErrorToUser: : errorLoginFailed: Request to Google API failed.

#21
fixed using this method sorry for the trouble.

No problem and welcome to Github.

@mgsx-dev do you think it is useful to change the error message to indicate the devs what's the problem? Or maybe clear the file automatically?

Exception is thrown inside Google's code and can only happen in development. So we just clarified the wiki entry.