filosganga / geogson

GeoJSON support for Google gson library
Apache License 2.0
69 stars 28 forks source link

Here is another crasher parsing FeatureCollection #42

Closed pixnbit closed 8 years ago

pixnbit commented 8 years ago

Here: https://gist.github.com/laoyang/d848cdd25ce41c36c1e701b7a952e6c2

Stack trace: 04-03 02:29:11.866 3660-3660/com.testtest.myapplication I/art: Not late-enabling -Xcheck:jni (already on) 04-03 02:29:11.949 3660-3660/com.testtest.myapplication W/System: ClassLoader referenced unknown path: /data/app/com.testtest.myapplication-1/lib/x86 04-03 02:29:11.951 3660-3660/com.testtest.myapplication I/InstantRun: BootstrapApplication created. Android package is com.testtest.myapplication, real application class is null. 04-03 02:29:11.952 3660-3660/com.testtest.myapplication I/InstantRun: Resource override is /data/data/com.testtest.myapplication/files/instant-run/left/resources.ap_ 04-03 02:29:11.952 3660-3660/com.testtest.myapplication I/InstantRun: Resource patch last modified: 1459675574000 04-03 02:29:11.952 3660-3660/com.testtest.myapplication I/InstantRun: APK last modified: 1459674969000 < resource patch 04-03 02:29:11.953 3660-3660/com.testtest.myapplication I/InstantRun: Bootstrapping class loader with dex list /data/data/com.testtest.myapplication/files/instant-run/dex/slice-support-annotations-23.2.1_325589ebf19ff619fa6d8ea81e4729efa60309cd-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_9-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_8-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_7-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_6-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_5-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_4-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_3-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_2-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_1-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_0-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-rxjava-1.1.2_46b322d9e694a2cc49ca364a68d0b5a3599672b4-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-retrofit-2.0.0_a145c6cb83c2f16bad8e7260a7d36d46129ba731-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-okio-1.6.0_44c0de9b9ea6b44faa369c48ddcad044f65b7168-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-okhttp-3.2.0_f1f03a3b4241db1eaf65f775a49d50ec372c29dc-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-javax.annotation-api-1.2_036e27015fa955be2f91556648f819cf33a1ef8d-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-io.reactivex-rxandroid-1.1.0_2919345eeda2e1ba8f371172154a0fdc920ab3de-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-internal_impl-23.2.1_7961efc55dd35e36eca1c9bb554d9c866fc578c8-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-guava-19.0_181561d34df26df11831c383aa03030b3f80c354-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-gson-2.6.2_fe5efd2628e05d4e7091011538631f7f2b5005bc-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-geogson-core-1.1.96_5dde6dc1eec27a80f2488c626ae74c4c42ee18c9-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-converter-gson-2.0.0_5313fa8424627cee326d12580b96155e250fde66-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.google.maps.android-android-maps-utils-0.4.3_cc86b95a57c7ea73d6c40acea53fe4aec78e0d44-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.google.android.gms-play-services-maps-8.4.0_5b14572dcb28a638239fc90e6ea74c08aebbbb41-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.google.android.gms-play-services-basement-8.4.0_34f8cacdcefbab92d32e64324a12eb90ec3fd212-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.google.android.gms-play-services-base-8.4.0_0737109e1b483d5b7e0eb3de045cbcee740b2851-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.android.support-support-vector-drawable-23.2.1_397510081a4f5e6d6a2782410b8ac74a08bc8dc4-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.android.support-support-v4-23.2.1_1da95a9bed6b13cab6c7fb164a30bcd3a76565e5-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.android.support-appcompat-v7-23.2.1_af5de204e1f5a5f47dfffa043f37e82c2006f8b9-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.android.support-animated-vector-drawable-23.2.1_d22e69e956076b25b60c8b1043c57450d8007bad-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-auto-value-1.2-rc1_623af15d032e75e09548234c467d3f5c728e8fe9-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-adapter-rxjava-2.0.0_b8e79532162faaa7aa34f2e38170ba1c65aa75b5-classes.dex 04-03 02:29:11.953 3660-3660/com.testtest.myapplication I/InstantRun: Native library path: /data/app/com.testtest.myapplication-1/lib/x86 04-03 02:29:11.953 3660-3660/com.testtest.myapplication I/InstantRun: Incremental dex path is /data/data/com.testtest.myapplication/files/instant-run/dex/slice-support-annotations-23.2.1_325589ebf19ff619fa6d8ea81e4729efa60309cd-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_9-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_8-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_7-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_6-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_5-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_4-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_3-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_2-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_1-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-slice_0-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-rxjava-1.1.2_46b322d9e694a2cc49ca364a68d0b5a3599672b4-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-retrofit-2.0.0_a145c6cb83c2f16bad8e7260a7d36d46129ba731-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-okio-1.6.0_44c0de9b9ea6b44faa369c48ddcad044f65b7168-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-okhttp-3.2.0_f1f03a3b4241db1eaf65f775a49d50ec372c29dc-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-javax.annotation-api-1.2_036e27015fa955be2f91556648f819cf33a1ef8d-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-io.reactivex-rxandroid-1.1.0_2919345eeda2e1ba8f371172154a0fdc920ab3de-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-internal_impl-23.2.1_7961efc55dd35e36eca1c9bb554d9c866fc578c8-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-guava-19.0_181561d34df26df11831c383aa03030b3f80c354-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-gson-2.6.2_fe5efd2628e05d4e7091011538631f7f2b5005bc-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-geogson-core-1.1.96_5dde6dc1eec27a80f2488c626ae74c4c42ee18c9-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-converter-gson-2.0.0_5313fa8424627cee326d12580b96155e250fde66-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.google.maps.android-android-maps-utils-0.4.3_cc86b95a57c7ea73d6c40acea53fe4aec78e0d44-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.google.android.gms-play-services-maps-8.4.0_5b14572dcb28a638239fc90e6ea74c08aebbbb41-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.google.android.gms-play-services-basement-8.4.0_34f8cacdcefbab92d32e64324a12eb90ec3fd212-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.google.android.gms-play-services-base-8.4.0_0737109e1b483d5b7e0eb3de045cbcee740b2851-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.android.support-support-vector-drawable-23.2.1_397510081a4f5e6d6a2782410b8ac74a08bc8dc4-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.android.support-support-v4-23.2.1_1da95a9bed6b13cab6c7fb164a30bcd3a76565e5-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.android.support-appcompat-v7-23.2.1_af5de204e1f5a5f47dfffa043f37e82c2006f8b9-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-com.android.support-animated-vector-drawable-23.2.1_d22e69e956076b25b60c8b1043c57450d8007bad-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-auto-value-1.2-rc1_623af15d032e75e09548234c467d3f5c728e8fe9-classes.dex /data/data/com.testtest.myapplication/files/instant-run/dex/slice-adapter-rxjava-2.0.0_b8e79532162faaa7aa34f2e38170ba1c65aa75b5-classes.dex 04-03 02:29:12.045 3660-3660/com.testtest.myapplication W/System: ClassLoader referenced unknown path: /data/app/com.testtest.myapplication-1/lib/x86 04-03 02:29:12.048 3660-3660/com.testtest.myapplication I/InstantRun: Starting server socket listening for package com.testtest.myapplication on android.net.LocalSocketAddress@4331afc 04-03 02:29:12.048 3660-3660/com.testtest.myapplication I/InstantRun: Started server for package com.testtest.myapplication 04-03 02:29:12.130 3660-3660/com.testtest.myapplication I/zzad: Making Creator dynamically 04-03 02:29:12.136 3660-3660/com.testtest.myapplication W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86 04-03 02:29:12.141 3660-3660/com.testtest.myapplication D/ChimeraCfgMgr: Reading stored module config 04-03 02:29:12.143 3660-3660/com.testtest.myapplication D/ChimeraCfgMgr: Loading module com.google.android.gms.maps from APK /data/user/0/com.google.android.gms/app_chimera/chimera-module-root/module-a3e4fba11e705727c59ff3116ef21fa4834b9f56/MapsModule.apk 04-03 02:29:12.143 3660-3660/com.testtest.myapplication D/ChimeraModuleLdr: Loading module APK /data/user/0/com.google.android.gms/app_chimera/chimera-module-root/module-a3e4fba11e705727c59ff3116ef21fa4834b9f56/MapsModule.apk 04-03 02:29:12.145 3660-3660/com.testtest.myapplication D/ChimeraFileApk: Primary ABI of requesting process is x86 04-03 02:29:12.145 3660-3660/com.testtest.myapplication D/ChimeraFileApk: Classloading successful. Optimized code found. 04-03 02:29:12.146 3660-3660/com.testtest.myapplication W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/chimera-module-root/module-a3e4fba11e705727c59ff3116ef21fa4834b9f56/native-libs/x86 04-03 02:29:12.158 3660-3660/com.testtest.myapplication I/Google Maps Android API: Google Play services client version: 8487000 04-03 02:29:12.160 3660-3660/com.testtest.myapplication I/Google Maps Android API: Google Play services package version: 8489470 04-03 02:29:12.249 3660-3660/com.testtest.myapplication I/e: Token loaded from file. Expires in: 431822041 ms. 04-03 02:29:12.249 3660-3660/com.testtest.myapplication I/e: Scheduling next attempt in 431522 seconds. 04-03 02:29:12.525 3660-3660/com.testtest.myapplication D/AndroidRuntime: Shutting down VM 04-03 02:29:12.526 3660-3660/com.testtest.myapplication E/AndroidRuntime: FATAL EXCEPTION: main Process: com.testtest.myapplication, PID: 3660 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.testtest.myapplication/com.testtest.myapplication.MainActivity}: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a name but was BEGIN_ARRAY at line 7 column 21 path $.features[0].label_area at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a name but was BEGIN_ARRAY at line 7 column 21 path $.features[0].label_area at com.google.gson.Gson.fromJson(Gson.java:891) at com.github.filosganga.geogson.gson.FeatureCollectionAdapter.read(FeatureCollectionAdapter.java:59) at com.github.filosganga.geogson.gson.FeatureCollectionAdapter.read(FeatureCollectionAdapter.java:19) at com.google.gson.Gson.fromJson(Gson.java:879) at com.google.gson.Gson.fromJson(Gson.java:844) at com.google.gson.Gson.fromJson(Gson.java:793) at com.google.gson.Gson.fromJson(Gson.java:765) at com.testtest.myapplication.MainActivity.onCreate(MainActivity.java:95) at android.app.Activity.performCreate(Activity.java:6237) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)  at android.app.ActivityThread.-wrap11(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  Caused by: java.lang.IllegalStateException: Expected a name but was BEGIN_ARRAY at line 7 column 21 path $.features[0].label_area at com.google.gson.stream.JsonReader.nextName(JsonReader.java:794) at com.github.filosganga.geogson.gson.FeatureAdapter.read(FeatureAdapter.java:82) at com.github.filosganga.geogson.gson.FeatureAdapter.read(FeatureAdapter.java:23) at com.google.gson.Gson.fromJson(Gson.java:879) at com.github.filosganga.geogson.gson.FeatureCollectionAdapter.read(FeatureCollectionAdapter.java:59)  at com.github.filosganga.geogson.gson.FeatureCollectionAdapter.read(FeatureCollectionAdapter.java:19)  at com.google.gson.Gson.fromJson(Gson.java:879)  at com.google.gson.Gson.fromJson(Gson.java:844)  at com.google.gson.Gson.fromJson(Gson.java:793)  at com.google.gson.Gson.fromJson(Gson.java:765)  at com.testtest.myapplication.MainActivity.onCreate(MainActivity.java:95)  at android.app.Activity.performCreate(Activity.java:6237)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)  at android.app.ActivityThread.-wrap11(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

filosganga commented 8 years ago

Hi Lao, I am looking at that.

filosganga commented 8 years ago

I am releasing the fixed version. I was not expecting having unknown properties in Geometry.

filosganga commented 8 years ago

The release 1.1.97 fixes that, thanks for your patience.

pixnbit commented 8 years ago

Thanks for the prompt fix!

pixnbit commented 8 years ago

Btw, parsing this json file took 236 ms on a Nexus 5.

filosganga commented 8 years ago

The performance are not good. The main source of slowness are the immutable guava collections. I will make a try with the pcollection but they are not very common. I will try not exposing them in the interface. On 4 Apr 2016 01:36, "Xiaochao Yang" notifications@github.com wrote:

Btw, parsing this json file took 236 ms on a Nexus 5.

— You are receiving this because you were assigned. Reply to this email directly or view it on GitHub https://github.com/filosganga/geogson/issues/42#issuecomment-205086009