pathsense / pathsense-samples-android

Sample Applications for the PathSense SDK
Other
26 stars 10 forks source link

Adding Geofence causes ClassCastException #12

Closed Kahtaf closed 6 years ago

Kahtaf commented 7 years ago

Hello,

Adding a geofence causes this error in logcat, which prints about once every second and clutters the log. Fortunately it doesn't result in the app crashing, but wondering if this can be resolved? Android 7.1.2, Nexus 6P.

PathsenseLocationProviderApi api = PathsenseLocationProviderApi.getInstance(this);
api.addGeofence(geofenceId, latLng.latitude, latLng.longitude, (int) radius, GeofenceTrasitionReceiver.class);
java.lang.ClassCastException: com.pathsense.locationengine.lib.models.data.t cannot be cast to com.pathsense.locationengine.lib.models.data.m
    at com.pathsense.locationengine.apklib.locationEngine.serviceControllers.d.a(Unknown Source)
    at com.pathsense.locationengine.apklib.locationEngine.serviceControllers.f.a(Unknown Source)
    at com.pathsense.locationengine.lib.detectionLogic.sensorCore.d.a(Unknown Source)
    at com.pathsense.locationengine.lib.detectionLogic.sensorCore.c.d(Unknown Source)
    at com.pathsense.locationengine.lib.detectionLogic.a$a.run(Unknown Source)
    at com.pathsense.locationengine.lib.concurrent.e.run(Unknown Source)
    at com.pathsense.locationengine.apklib.concurrent.c$a.handleMessage(Unknown Source)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6121)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
dyerjo commented 7 years ago

Hi,

This looks to be an issue when using both the Geofencing and In-Vehicle Location API, together. Specifically, requestInVehicleLocationUpdates() and addGeofence().

We will fix this issue and provide an update, as soon as possible.

Thank you, John Dyer

On Jun 7, 2017, at 8:45 PM, Kahtaf Alam notifications@github.com wrote:

com.pathsense.locationengine.lib.detectionLogic.sensorCore.c

Kahtaf commented 7 years ago

Hi John,

Yes, that aligns with what I'm doing. Thanks for the quick response.

dyerjo commented 6 years ago

This error has been fixed on the latest release. Please, update to PathSense Android SDK 3.1.0.6.