mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
430 stars 126 forks source link

geoJsonSource crash Parcel: unknown type for value #2367

Closed digitaldjango closed 3 weeks ago

digitaldjango commented 3 weeks ago

Environment

Observed behavior and steps to reproduce

So I just updated to the latest mapbox version. Updated my code to work with the latest version of the experimental compose plugin in accordance with the examples here. However now I'm getting these crash reports in firebase. So far I've been unable to reproduce this myself but the log is very clear.

Fatal Exception: java.lang.IllegalArgumentException: Parcel: unknown type for value {"id":"151","geometry":{"type":"GeometryCollection","geometries":[{"type":"Polygon","coordinates":[[[4.718486819,52.011458724],[4.718251692,52.013077127],[4.71895223,52.01316728],[4.718767994,52.013730882],[4.719035472,52.013766158],[4.719150105,52.013546657],[4.719939803,52.013621131],[4.720028962,52.013362433],[4.719468532,52.013244842],[4.71973601,52.012355062],[4.720009857,52.012233548],[4.719895223,52.012084596],[4.71951948,52.012182591],[4.719169211,52.011892526],[4.719124631,52.011837648],[4.719131,52.011680855],[4.718486819,52.011458724]]]}]},"properties":{"name":"Gouda 2","notes":"Gericht onderzoek","mediaItems":[]},"type":"Feature"}
       at android.os.Parcel.getValueType(Parcel.java:2409)
       at android.os.Parcel.writeValue(Parcel.java:2308)
       at com.mapbox.maps.extension.compose.style.sources.SourceState$Holder.writeToParcel(SourceState.kt:104)
       at android.os.Parcel.writeParcelable(Parcel.java:2538)
       at android.os.Parcel.writeValue(Parcel.java:2439)
       at android.os.Parcel.writeValue(Parcel.java:2316)
       at android.os.Parcel.writeList(Parcel.java:1382)
       at android.os.Parcel.writeValue(Parcel.java:2460)
       at android.os.Parcel.writeValue(Parcel.java:2316)
       at android.os.Parcel.writeMapInternal(Parcel.java:1233)
       at android.os.Parcel.writeMap(Parcel.java:1215)
       at android.os.Parcel.writeValue(Parcel.java:2430)
       at android.os.Parcel.writeValue(Parcel.java:2316)
       at android.os.Parcel.writeMapInternal(Parcel.java:1233)
       at android.os.Parcel.writeMap(Parcel.java:1215)
       at android.os.Parcel.writeValue(Parcel.java:2430)
       at android.os.Parcel.writeValue(Parcel.java:2316)
       at android.os.Parcel.writeList(Parcel.java:1382)
       at android.os.Parcel.writeValue(Parcel.java:2460)
       at android.os.Parcel.writeValue(Parcel.java:2316)
       at android.os.Parcel.writeArrayMapInternal(Parcel.java:1265)
       at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1802)
       at android.os.Bundle.writeToParcel(Bundle.java:1362)
       at android.os.Parcel.writeBundle(Parcel.java:1334)
       at android.os.Parcel.writeValue(Parcel.java:2433)
       at android.os.Parcel.writeValue(Parcel.java:2323)
       at android.os.Parcel.writeArrayMapInternal(Parcel.java:1265)
       at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1802)
       at android.os.Bundle.writeToParcel(Bundle.java:1362)
       at android.os.Parcel.writeBundle(Parcel.java:1334)
       at android.os.Parcel.writeValue(Parcel.java:2433)
       at android.os.Parcel.writeValue(Parcel.java:2323)
       at android.os.BaseBundle.dumpStats(BaseBundle.java:1874)
       at android.os.BaseBundle.dumpStats(BaseBundle.java:1911)
       at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:150)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:201)
       at android.os.Looper.loop(Looper.java:288)
       at android.app.ActivityThread.main(ActivityThread.java:8163)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:946)

Seems like the geojson source is try to parcelize the data and the model seems to be missing that.

Expected behavior

No crashes

mulledwineapps commented 3 weeks ago

I see the same exception in Logcat when I press the home button on my map screen

kiryldz commented 3 weeks ago

@digitaldjango @mulledwineapps can you try https://github.com/mapbox/mapbox-maps-android/releases/tag/v11.4.0-rc.1?

mulledwineapps commented 3 weeks ago

@kiryldz everything looks fine with 11.4.0-rc01, thank you.

digitaldjango commented 1 week ago

Indeed solved by updateing however I now get other crashes that seem related: https://github.com/mapbox/mapbox-maps-android/issues/2381