PokeGOAPI-Java icon indicating copy to clipboard operation
PokeGOAPI-Java copied to clipboard

exception in GoogleUserCredentialProvider

Open jchunly opened this issue 10 years ago • 22 comments

Hi. Here my code. where token is the string returned by the web Authenticating google . all code is inside a asytask

OkHttpClient http = new OkHttpClient(); try{ GoogleUserCredentialProvider provider = new GoogleUserCredentialProvider(http); Scanner sc = new Scanner(token); String access = sc.nextLine(); provider.login(access); PokemonGo go = new PokemonGo(provider, http); }catch(LoginFailedException e){ Log.d("Julian","Fallo en el login",e); }catch(RemoteServerException e){ Log.d("Julian","Fallo en el servidor ",e); }

Upon reaching the line of pokemon go gives me the following exception .

com.pokegoapi.exceptions.LoginFailedException: invalid_request 07-29 17:24:41.759 1239 1357 D Julian com.jchunly.pokenotificator2 at com.pokegoapi.auth.GoogleUserCredentialProvider.refreshToken(GoogleUserCredentialProvider.java:159) 07-29 17:24:41.759 1239 1357 D Julian com.jchunly.pokenotificator2 at com.pokegoapi.auth.GoogleUserCredentialProvider.getAuthInfo(GoogleUserCredentialProvider.java:232) 07-29 17:24:41.759 1239 1357 D Julian com.jchunly.pokenotificator2 at com.pokegoapi.api.PokemonGo.getAuthInfo(PokemonGo.java:93) 07-29 17:24:41.759 1239 1357 D Julian com.jchunly.pokenotificator2 at com.pokegoapi.main.RequestHandler.resetBuilder(RequestHandler.java:253) 07-29 17:24:41.759 1239 1357 D Julian com.jchunly.pokenotificator2 at com.pokegoapi.main.RequestHandler.resetBuilder(RequestHandler.java:238) 07-29 17:24:41.759 1239 1357 D Julian com.jchunly.pokenotificator2 at com.pokegoapi.main.RequestHandler.(RequestHandler.java:60) 07-29 17:24:41.759 1239 1357 D Julian com.jchunly.pokenotificator2 at com.pokegoapi.api.PokemonGo.(PokemonGo.java:74)

jchunly avatar Jul 29 '16 15:07 jchunly

com.pokegoapi.exceptions.RemoteServerException: com.google.protobuf.InvalidProtocolBufferException: Contents of buffer are null 07-29 17:54:23.459 5487 5679 D Julian com.jchunly.pokenotificator2 at com.pokegoapi.api.inventory.Inventories.updateInventories(Inventories.java:114) 07-29 17:54:23.459 5487 5679 D Julian com.jchunly.pokenotificator2 at com.pokegoapi.api.inventory.Inventories.updateInventories(Inventories.java:84) 07-29 17:54:23.459 5487 5679 D Julian com.jchunly.pokenotificator2 at com.pokegoapi.api.inventory.Inventories.(Inventories.java:74) 07-29 17:54:23.459 5487 5679 D Julian com.jchunly.pokenotificator2 at com.pokegoapi.api.PokemonGo.(PokemonGo.java:76) 07-29 17:54:23.459 5487 5679 D Julian com.jchunly.pokenotificator2

jchunly avatar Jul 29 '16 15:07 jchunly

You are tying to make too much requests at the same time, just sleep between request. (for the second strackrace you got)

vmarchaud avatar Jul 29 '16 15:07 vmarchaud

Verify that you are on the latest version of our dev branch, i cant reproduce the problem.

vmarchaud avatar Jul 29 '16 16:07 vmarchaud

I can reproduce this, I'm not able do call any of the api's methods.

medusalix avatar Jul 29 '16 16:07 medusalix

hello may be that all problems have it is that I am intentanto accessed from developing android ???

I can not download the code as the import of da muchisimos code errors with what I have doubts that this code is not adapted to android.

where you could unburden a jar file of the updated library with codes ?

jchunly avatar Jul 29 '16 16:07 jchunly

I don't think this is related to Android. I'm developing a standard application and I get this exception.

medusalix avatar Jul 29 '16 17:07 medusalix

@jchunly https://translate.google.com?

Aphoh avatar Jul 29 '16 17:07 Aphoh

I use it. Thank you

jchunly avatar Jul 29 '16 17:07 jchunly

@vmarchaud do you know when you are going to release or merge the dev branch with master ?

adobeSlash avatar Jul 29 '16 18:07 adobeSlash

Hi, I'm testing and I realize that when I try to connect with the same token that gives me the web of google gives me error.

I have to ask every time a new token? or I have to make a refreshtoken and save it for later connections result?

jchunly avatar Jul 29 '16 18:07 jchunly

it increasingly using a different token, it gives me error on the server. It is possible to download a jar file with the current code because I have one but not the GoogleUserCredentialProvider class and I have to add manually. If I download all code and add in the project it gives me many mistakes.

a greeting. and thanks for the help.

jchunly avatar Jul 29 '16 19:07 jchunly

@jchunly You could use Jitpack, which automatically compiles the code from the Github repo.

medusalix avatar Jul 29 '16 19:07 medusalix

it's not the dev branch isn't it ?

adobeSlash avatar Jul 29 '16 19:07 adobeSlash

Yeah, I was just editing it :smile:

medusalix avatar Jul 29 '16 19:07 medusalix

so @jchunly you have to fork it. Just click on fork from the main page, top left

adobeSlash avatar Jul 29 '16 19:07 adobeSlash

@adobeSlash It is the dev branch, I edited the link to point to the Development-SNAPSHOT branch. That's what I'm currently using.

medusalix avatar Jul 29 '16 19:07 medusalix

So, are we agree that the issue is revolved on the dev branch ?

vmarchaud avatar Jul 29 '16 19:07 vmarchaud

No, I am using the dev branch and I'm not able to login.

If I login without a token, I get no exception util I call any of the api-functions.

medusalix avatar Jul 29 '16 20:07 medusalix

Im able to sign in with the google login. The only think im not using is the java Scanner object. And android devs should now that this isn´t available for android (obviously).

FabianTerhorst avatar Jul 29 '16 21:07 FabianTerhorst

This is not an issue...

I'm at dev branch, can login with google token, and with ptc login/password

if you can't login right now it's because server is unstable

bolds07 avatar Jul 29 '16 21:07 bolds07