You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
The code that matches up with the stacktrace points to MapboxEventManager.java:621 is related to sending the event's latitude information in to the server (see code block below). This data is generated from the stock Android Location.getLatitude(). According to the documentation if the Location is generated by the stock LocationManager there will always be "valid latitude".
The next step is to learn more about how the App in question is generating Location data as well as adding an explicit NaN check to Latitude and Longitude to keep the SDK from trying to send data like this. The good news is that SDK behaved exactly as required in this situation in that it handled the error but did not crash the app.
// Line 621jsonObject.putOpt(MapboxEvent.KEY_LATITUDE, evt.get(MapboxEvent.KEY_LATITUDE));
I found out from @ivovandongen that the App generates Location data using the stock Android Location API, Google Play Services Location API, and Google Fit. This means that the data sources are going to be pretty reliable / consistent in terms of what is presented. Since the crash itself actually occurred at the JSONObject level I added checks for NaN and Infinite values for latitude, longitude, and altitude during the Location Event processing to make the whole process more efficient. The result is if any of those 3 values are NaN or Infinite then the Location event is ignored and not processed, thus keeping the JSONObject from having troubles per it's documentation.
Activity
ivovandongen commentedon Jun 24, 2016
cc @zugaldia
zugaldia commentedon Jun 27, 2016
/cc: @bleege
bleege commentedon Jun 27, 2016
Thanks for spotting this @ivovandongen. This is a blocker to 4.1.0 Final. I'll pick it up.
bleege commentedon Jun 27, 2016
The code that matches up with the stacktrace points to
MapboxEventManager.java:621is related to sending the event's latitude information in to the server (see code block below). This data is generated from the stock AndroidLocation.getLatitude(). According to the documentation if the Location is generated by the stock LocationManager there will always be "valid latitude".The next step is to learn more about how the App in question is generating Location data as well as adding an explicit
NaNcheck to Latitude and Longitude to keep the SDK from trying to send data like this. The good news is that SDK behaved exactly as required in this situation in that it handled the error but did not crash the app.[android] #5470 - Adding NaN and Infinite checks to location event tr…
bleege commentedon Jun 27, 2016
I found out from @ivovandongen that the App generates Location data using the stock Android Location API, Google Play Services Location API, and Google Fit. This means that the data sources are going to be pretty reliable / consistent in terms of what is presented. Since the crash itself actually occurred at the JSONObject level I added checks for
NaNandInfinitevalues for latitude, longitude, and altitude during the Location Event processing to make the whole process more efficient. The result is if any of those 3 values areNaNorInfinitethen the Location event is ignored and not processed, thus keeping the JSONObject from having troubles per it's documentation.bleege commentedon Jun 27, 2016
I just merged this into the
release-android-v4.1.0branch and will now kick off a new SNAPSHOT so that we can make use of it sooner.ivovandongen commentedon Jul 15, 2016
@bleege Just had another one. Is this merged back in master correctly?
bleege commentedon Jul 19, 2016
@ivovandongen Which version of the SDK are you seeing this on?
bleege commentedon Jul 19, 2016
Also #5682 found some extra NaN issues related to Gestures and is now in
master.ivovandongen commentedon Jul 21, 2016
@bleege This was on master.
bleege commentedon Jul 25, 2016
@ivovandongen Are you still experiencing this on
masteror have things smoothed out since #5682 was introduced?ivovandongen commentedon Jul 26, 2016
@bleege Haven't been on master recently or actively running the test-app. Will need to do that soon anyway to work on examples, I'll let you know.
zugaldia commentedon Sep 22, 2016
We haven't seen this recently, closing. Feel free to reopen if the problem resurfaces.