SweetzpotAS / StravaZpot-Android

A fluent API to integrate with Strava on Android apps
70 stars 36 forks source link

Crash in an strava account recent created #3

Closed danieltigse closed 7 years ago

danieltigse commented 7 years ago

This is the error log:

12-17 11:43:56.401 31885-32148/com.cajanegra.stam W/System.err: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a name but was NULL at line 1 column 30 path $.biggest_ride_distance
12-17 11:43:56.402 31885-32148/com.cajanegra.stam W/System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224)
12-17 11:43:56.402 31885-32148/com.cajanegra.stam W/System.err:     at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:37)
12-17 11:43:56.402 31885-32148/com.cajanegra.stam W/System.err:     at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:25)
12-17 11:43:56.402 31885-32148/com.cajanegra.stam W/System.err:     at retrofit2.ServiceMethod.toResponse(ServiceMethod.java:117)
12-17 11:43:56.402 31885-32148/com.cajanegra.stam W/System.err:     at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:211)
12-17 11:43:56.402 31885-32148/com.cajanegra.stam W/System.err:     at retrofit2.OkHttpCall.execute(OkHttpCall.java:174)
12-17 11:43:56.402 31885-32148/com.cajanegra.stam W/System.err:     at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall.execute(ExecutorCallAdapterFactory.java:89)
12-17 11:43:56.402 31885-32148/com.cajanegra.stam W/System.err:     at com.sweetzpot.stravazpot.common.api.StravaAPI.execute(StravaAPI.java:26)
12-17 11:43:56.402 31885-32148/com.cajanegra.stam W/System.err:     at com.sweetzpot.stravazpot.athlete.request.GetTotalsAndStatsRequest.execute(GetTotalsAndStatsRequest.java:23)
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err:     at com.cajanegra.stam.PerfilActivity$5$1$1.doInBackground(PerfilActivity.java:477)
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err:     at com.cajanegra.stam.PerfilActivity$5$1$1.doInBackground(PerfilActivity.java:468)
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:295)
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err:     at java.lang.Thread.run(Thread.java:818)
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err: Caused by: java.lang.IllegalStateException: Expected a name but was NULL at line 1 column 30 path $.biggest_ride_distance
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err:     at com.google.gson.stream.JsonReader.nextName(JsonReader.java:789)
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215)
12-17 11:43:56.403 31885-32148/com.cajanegra.stam W/System.err:     ... 16 more

This is the json that the lib is trying to parse

{
"biggest_ride_distance": null,
"biggest_climb_elevation_gain": null,
"recent_ride_totals": {
"count": 0,
"distance": 0,
"moving_time": 0,
"elapsed_time": 0,
"elevation_gain": 0,
"achievement_count": 0
},
"recent_run_totals": {
"count": 1,
"distance": 7366.60009765625,
"moving_time": 2788,
"elapsed_time": 2828,
"elevation_gain": 52.69230651855469,
"achievement_count": 0
},
"recent_swim_totals": {
"count": 0,
"distance": 0,
"moving_time": 0,
"elapsed_time": 0,
"elevation_gain": 0,
"achievement_count": 0
},
"ytd_ride_totals": {
"count": 0,
"distance": 0,
"moving_time": 0,
"elapsed_time": 0,
"elevation_gain": 0
},
"ytd_run_totals": {
"count": 1,
"distance": 7367,
"moving_time": 2788,
"elapsed_time": 2828,
"elevation_gain": 53
},
"ytd_swim_totals": {
"count": 0,
"distance": 0,
"moving_time": 0,
"elapsed_time": 0,
"elevation_gain": 0
},
"all_ride_totals": {
"count": 0,
"distance": 0,
"moving_time": 0,
"elapsed_time": 0,
"elevation_gain": 0
},
"all_run_totals": {
"count": 1,
"distance": 7367,
"moving_time": 2788,
"elapsed_time": 2828,
"elevation_gain": 53
},
"all_swim_totals": {
"count": 0,
"distance": 0,
"moving_time": 0,
"elapsed_time": 0,
"elevation_gain": 0
}
}

Please fix it. I know It is just a validation.

truizlop commented 7 years ago

Hi Daniel, thanks for posting the issue. I'll investigate it and publish a fix next week.

danieltigse commented 7 years ago

Thanks. I will appreciate it If you fix it as soon as possible :)

truizlop commented 7 years ago

Version 1.0.2 has been published fixing this issue. Update your Gradle file to check out this new version. Thanks for using StravaZpot!

danieltigse commented 7 years ago

Thanks man!