lost
lost copied to clipboard
LostApiClient is not connected in onConnected
Description
I have Firebase Crashlytics integrated in the app and I get a lot of stack traces like this:
Fatal Exception: java.lang.IllegalStateException
LostApiClient is not connected.
com.mapzen.android.lost.internal.ApiImpl.throwIfNotConnected (ApiImpl.java:11)
com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.getLastLocation (FusedLocationProviderApiImpl.java:134)
org.traccar.client.ShortcutActivity.onConnected (ShortcutActivity.java:115)
com.mapzen.android.lost.internal.FusedLocationServiceConnectionManager.onServiceConnected (FusedLocationServiceConnectionManager.java:86)
com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.onServiceConnected (FusedLocationProviderApiImpl.java:94)
As you can see, for some reason I get LostApiClient is not connected
exception in onConnected
callback.
Here is the code of my app:
Basically I have a shortcut activity where I want to immediately get last known location and send it to the server.
Steps to Reproduce
Unfortunately I don't have information on how to reproduce it, but there are quite a few reported crashed on different device models.
Lost & Android Version
Lost version: 3.0.4
Android versions:
- 8.0.0
- 7.1.1
- 7.0
- 6.0.1
- 6.0
- 5.1.1
Now reproducible with https://github.com/traccar/traccar-client-android/issues/349.
Closing as this repo is no longer maintained.