Closed baskettcase closed 7 years ago
I can't reproduce the problem. Could you provide me with additional details as well as the full stack trace?
How would I go about doing that since this is a fatal error?
You can get hold of the trace using xdebug.
Ok I took a look at installing it and Im on a shared server so that wont work for xdebug. I tested the RetrievePokemonTraitExample without any of my modifications except for google/user/pass and I still get the same error.
I also tried GUI_BestCpPokemonDetails.php and I get the same error there also.
Im running 64 bit.
I was able to reproduce the problem with a new account. The issue is due to a bug within the protocol buffer library https://github.com/google/protobuf
Try updating the dependencies. I have hopefully fixed the issue in my fork of google/protobuf repo. You might get some notice messages, I'll fix them later.
https://github.com/NicklasWallgren/protobuf/commit/4f29e1337f40111494d2131dc613a3ab6ea94b8f
It goes further.
Some notices in code
Notice: Undefined offset: 2 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 0 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 2 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 0 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 2 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 0 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 2 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 0 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 2 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 0 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 2 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 0 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 25 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Notice: Undefined offset: 128787628 in C:\WTServer\WWW\pogo\vendor\nicklasw\protobuf\php\src\Google\Protobuf\descriptor.php on line 158 Warning: unpack() expects parameter 2 to be string, object given in C:\WTServer\WWW\pogo\web\update.php on line 104
Then
Fatal error: Uncaught Error: Call to undefined method POGOProtos\Enums\PokemonId::toString() in C:\WTServer\WWW\pogo\web\update.php:161 Stack trace: #0 C:\WTServer\WWW\pogo\web\update.php(570): MyPogo->updateDataFromNiantic('user', 'password', 'ptc', 'C:\\Users\\admin\\...') #1 {main} thrown in C:\WTServer\WWW\pogo\web\update.php on line 161
I will try with offcial samples.
RetrievePokemonCandyCountExample.php works 👍
The notice message has been suppressed as of 3.1.2 of google/protobuf.
The 'POGOProtos\Enums\PokemonId' class has been replaced with 'NicklasW\PkmGoApi\Api\Support\PokemonId'
And the 'toString' method is now called 'name'
PokemonId::name($id);
Can we close this issue?
I get this now:
Fatal error: Call to undefined method POGOProtos\Inventory\AppliedItems::getItemArray() in /home/account/public_html/games/pokemongo/vendor/nicklasw/pkm-go-api/src/Api/Player/Data/Inventory/AppliedItems.php on line 44
@baskettcase Fixed in https://github.com/NicklasWallgren/PokemonGoAPI-PHP/tree/v2.0.2
Awesome looks like it works now! It also looks like there are some strange things happening.. maybe a lot has changed. Ill look into it. Thanks again for getting this fixed!
Resolved.
Im getting this error and can't seem to get away from it.
Fatal error: Call to a member function getType() on null in /home/account/public_html/games/pokemongo/vendor/nicklasw/protobuf/php/src/Google/Protobuf/Internal/Message.php on line 319
This is for the RetrievePokemonTraitExample script,. The main difference I have between your example and what I did was I did this
$pokemons = $pokeBank->getPokemons()->sortByIVRatio(true);
Any ideas?