Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: Attempt to invoke virtual method 'com.google.protobuf.CodedInputStream com.google.protobuf.ByteString.newCodedInput()' on a null object reference #47

Closed
halsafar opened this issue Jul 19, 2016 · 7 comments

Comments

@halsafar
Copy link

This just started in the last 24 hours with some updates to the repo and POGOProtos.

Running the following:
EnvelopesOuterClass.Envelopes.RequestEnvelope.AuthInfo auth = new PTCLogin(client).login(username, password); Log.d(LOG_TAG, auth.toString()); PokemonGoApi = new PokemonGo(auth, client);

Yields this:

java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.protobuf.CodedInputStream com.google.protobuf.ByteString.newCodedInput()' on a null object reference
System.err:     at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:104)
System.err:     at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:125)
System.err:     at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:130)
System.err:     at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:49)
System.err:     at POGOProtos.Networking.Responses.GetPlayerResponseOuterClass$GetPlayerResponse.parseFrom(GetPlayerResponseOuterClass.java:230)
System.err:     at com.pokegoapi.api.PokemonGo.getLocalPlayer(PokemonGo.java:72)
System.err:     at com.pokegoapi.api.PokemonGo.getPlayerProfile(PokemonGo.java:89)
System.err:     at com.pokegoapi.api.PokemonGo.<init>(PokemonGo.java:53)
System.err:     at Application.loginTest(Application.java:32)

Sometimes it is yielding this exception as well:

com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group tag did not match expected tag.

Apologies if this is just simply that their API has changed over night.

I am almost ready to push to here a fully working Android version but I need to get this resolved.

@guipenedo
Copy link
Contributor

https://github.com/Grover-c13/PokeGOAPI-Java/blob/master/src/main/java/com/pokegoapi/auth/GoogleLogin.java#L45
You can no longer login using username and password. You'll have to use oauth.

@vmarchaud
Copy link
Contributor

This come from the niantic server being under heavy load, there are very unstable, check the status here.
Btw @guipenedo he is loggin via PTC, its working with username/password.

@guipenedo
Copy link
Contributor

ups sorry about that I misread. thanks for the correction @vmarchaud

@jabbink
Copy link
Collaborator

jabbink commented Jul 19, 2016

Yeah, this error is related to the servers being offline right now.

@jabbink jabbink closed this as completed Jul 19, 2016
@halsafar
Copy link
Author

Thanks for the clarification. It must be server load. If I run the same piece of code a bunch of times in a row I get slightly different results.

  • InvalidProtocolBuffer Exception
  • The null ptr exception I posted.
  • No exception and a NULL Player Profile (no data).

If this is all expected due to the naintic servers being under heavy load then lets close this.

@halsafar
Copy link
Author

Noted.

@jabbink
Copy link
Collaborator

jabbink commented Jul 19, 2016

No exception and a NULL Player Profile (no data).

That is actually a bug waiting to be fixed in #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants