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

Crash - Location update received after client was disconnected. #9285

Closed
giperwlad opened this issue Jun 16, 2017 · 1 comment
Closed

Crash - Location update received after client was disconnected. #9285

giperwlad opened this issue Jun 16, 2017 · 1 comment
Labels
Android Mapbox Maps SDK for Android

Comments

@giperwlad
Copy link

Hello and thanks for contributing!

Sometimes when screen rotated or activity destroyed, crash occurs:

`java.lang.IllegalStateException: Location update received after client was disconnected. Did you forget to unregister location updates before disconnecting?
                                                                    at com.mapzen.android.lost.internal.FusedLocationServiceCallbackManager.onLocationChanged(FusedLocationServiceCallbackManager.java:31)
                                                                    at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl$1$1.run(FusedLocationProviderApiImpl.java:47)
                                                                    at android.os.Handler.handleCallback(Handler.java:751)
                                                                    at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                    at android.os.Looper.loop(Looper.java:154)
                                                                    at android.app.ActivityThread.main(ActivityThread.java:6682)
                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)`

Platform: Android
Mapbox SDK version: 5.1.0-beta.3

Steps to trigger behavior

  1. call method setMyLocationEnabled(true);

I don't use locationEngineListener. But for the experiment I tried to add locationEngineListener and remove it on destoy activity. But It did not help. Also i tried to call this methods in onDestroy:

`     mapboxMap.setMyLocationEnabled(false);
        TelemetryUtils.getSharedPreferences(context).edit().putBoolean(TelemetryConstants.MAPBOX_SHARED_PREFERENCE_KEY_TELEMETRY_ENABLED, false).apply();
        LocationEngine locationEngine=LocationSource.getLocationEngine(context);
        locationEngine.removeLocationUpdates();
        locationEngine.removeLocationEngineListener(locationEngineListener);
        locationEngine.deactivate();`

But It did not help. I managed to find a similar problem only here #8999 but I did not find a solution to the problem.

Please, help to understand a strange problem.

@Guardiola31337 Guardiola31337 added the Android Mapbox Maps SDK for Android label Jun 16, 2017
@Guardiola31337
Copy link
Contributor

@giperwlad thanks for reaching out and report your problem.

The issue is being tracked here lost#218. Any info that you could add to that ticket is more than welcome. Thanks again.

Closing here.

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

No branches or pull requests

2 participants