Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Crash on map click from AnnotationManager #9584

Closed
cvance opened this issue Jul 21, 2017 · 5 comments
Closed

Crash on map click from AnnotationManager #9584

cvance opened this issue Jul 21, 2017 · 5 comments
Assignees
Labels
Android Mapbox Maps SDK for Android crash

Comments

@cvance
Copy link

cvance commented Jul 21, 2017

Platform: Android 7.0
Mapbox SDK version: 5.1.1

Steps to trigger behavior

  1. Single tap on map anywhere

Actual behavior

App crashes with following stacktrace:

java.lang.NumberFormatException: For input string: "" at java.lang.Long.parseLong(Long.java:455) at java.lang.Long.valueOf(Long.java:542) at com.mapbox.mapboxsdk.maps.AnnotationManager$ShapeAnnotationHitResolver.execute(AnnotationManager.java:729) at com.mapbox.mapboxsdk.maps.AnnotationManager.onTap(AnnotationManager.java:651) at com.mapbox.mapboxsdk.maps.MapGestureDetector$GestureListener.onSingleTapConfirmed(MapGestureDetector.java:318) at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:300) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

@Guardiola31337 Guardiola31337 added Android Mapbox Maps SDK for Android crash labels Jul 22, 2017
@tobrun
Copy link
Member

tobrun commented Jul 22, 2017

Thank you for the report, haven't seen this crash with regular testing using the testapp and our base styles. In this case a query for features was done but the feature returned didn't include an id. I assumed id was required but the geojson spec doesn't enforce this:

If a Feature has a commonly used identifier, that identifier
SHOULD be included as a member of the Feature object with the name
"id", and the value of this member is either a JSON string or
number.

Will add a fix, to be included with next patch release.

@tobrun
Copy link
Member

tobrun commented Jul 24, 2017

I'm a bit curious about the setup you have in place for reproducing this issue. For querying the map we only use layers that where added through addPolygon/addPolyline.

mapboxMap.queryRenderedFeatures(shapeHit.tapPoint, shapeHit.layerIds)

I'm going to harden the integration though the crash in OP shouldn't happen in normal use-cases.

@tobrun
Copy link
Member

tobrun commented Jul 28, 2017

@cvance feel free to test out the 5.1.2-SNAPSHOT with the fix.

@cvance
Copy link
Author

cvance commented Jul 28, 2017

Will do! Thanks!

@cvance
Copy link
Author

cvance commented Jul 28, 2017

Looks good to me! Thanks once again for the quick response and fix!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android crash
Projects
None yet
Development

No branches or pull requests

3 participants