Search code examples
androidibm-mobilefirstworklight-geolocation

Random crash while retrieving the lat/long using worklight 6.2 Android acquireGeoPosition API


My Android app tries to retrieve the current location of the device using the Worklight Android API acquireGeoPosition.

The geo policy details are as mentioned below -

    WLGeoAcquisitionPolicy geoPolicy = WLGeoAcquisitionPolicy.getLiveTrackingProfile();
    geoPolicy.setTimeout(60000); 
    geoPolicy.setMaximumAge(15000);

Couple of times, I have noticed app crashing with the below stacktrace that says 'altitude must be non-negative, was -500.0'. Any clues on what could have triggered this crash pls...

FATAL EXCEPTION: Thread-361

java.lang.IllegalArgumentException: altitude must be non-negative, was -500.0
    at com.worklight.location.api.geo.WLCoordinate.<init>(WLCoordinate.java:73)
    at com.worklight.location.internal.geo.nativeImpl.AndroidLocationListener.convertToPosition(AndroidLocationListener.java:145)
    at com.worklight.location.internal.geo.nativeImpl.AndroidLocationListener.onLocationChanged(AndroidLocationListener.java:140)
    at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:268)
    at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:201)
    at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java:224)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at com.worklight.location.internal.nativeImpl.AndroidRunnableExecutor$1.run(AndroidRunnableExecutor.java:45)
    at java.lang.Thread.run(Thread.java:856)

Solution

  • This has been identified as a possible defect.

    To have it investigated as well as receive a fix, you need to have the customer open a PMR for IBM so that an iFix could be provided, once available.