Error when using GoogleAutoCredentialProvider
When i instanciate GoogleAutoCredentialProvider, i have this exception :
java.lang.NoClassDefFoundError: Failed resolution of: Lsvarzee/gps/gpsoauth/Gpsoauth;
I tested this with an oldest jar of the api, it's working, so there is an issue in the latest version of the api.
This is my code :
OkHttpClient httpClient = new OkHttpClient();
GoogleAutoCredentialProvider provider = new GoogleAutoCredentialProvider(httpClient, username, password);
PokemonGo go = new PokemonGo(provider, httpClient);
Add compile 'svarzee.gps:gpsoauth:0.3' to gradle.build under dependencies
This resolved the Lsvarzee error, but the auth still not working, when i debug my app a problem occurs in the class Gpsoauth.java in this line :
return httpClient.newCall(request).execute();
When i reach this line there is no triggered exception, but there is no response from the call, the debugger still blocked in this line.
There was only a slight chance importing that dependency would override the one from the library. You'd have to build the library to resolve the issue of that didn't work.
i checked this when debugging my app, it's using the Gpsoauth class from the imported dependency, i checked too if this class exists in the api but nothing.
Could you resolve your problem?
Close this for now looks unrelated to this library.
No, i not resolved my problem
We need an updated jcenter dependencie to better debug this.
httpClient.newCall(request).execute(); is most likely being implemented incorrectly.
See https://github.com/Grover-c13/PokeGOAPI-Java#usage-example-mostly-how-to-login-
and https://github.com/Grover-c13/PokeGOAPI-Java/tree/Development/sample/src/main/java/com/pokegoapi/examples
@LoungeKatt The example is showing the usage of GoogleUserCredentialProvider, but in my case i try to use the GoogleAutoCredentialProvider which is different, this auth mode worked in previous versions of the API but now i think there is a regression in the last version.
The line httpClient.newCall(request).execute(); is in the class Gpsoauth.java from the API source code, by debugging this class i noticed that's the problem occurs in this call.
The reason only one example is shown is that each credential provider is designed to follow the same structure. The issue is that you appear to be attempting to recreate the inner functionality locally.
No i'm just trying to use the credentials provider as shown in the example, look at my first post it's contains my source code.
Then there should be no issue with Gpsoauth, since that is an external dependency handled by the API library. You should verify you are using the library-all file that includes the dependencies.
Perhaps it would be best to wait for the bintray build of the library to update, since the problem appears to be specific to your build of the library.
now i'm using the PokeGOAPI-library-0.4.0.jar that's i builded from a clean clone of the API source code, this jar does not contains svarzee.gps dependency required by the the API, resulting of the error i described in a earlier post. In the previous versions of the API the dependecy was included, i can't understand why the developors removed it in the last version. So i added the depenency in my project to resolve the problem, but i can't figure out why it's still not working like it was when the dependecy was included in the API, this is the question..
You want PokeGOAPI-library-all-0.4.0.jar. This is the exact name of the file.
The developers did not remove the dependency, you are using the wrong file.
https://github.com/Grover-c13/PokeGOAPI-Java/blob/Development/library/build.gradle#L94
ok this resolved my problem, now i still getting 0 results from the getCatchablePokemon method, look at https://github.com/Grover-c13/PokeGOAPI-Java/issues/513 issue
Update : i tried also with a new Ptc account, and i added DeviceInfo a SensorInfo data to PokemonGo object but it still returning 0 results.
you know what sensorinfo needs for the values?
sensorInfo.setAccelNormalizedZ(0);
It needs more values ?
We don´t know what to set for the other values.