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.
I'm writing an application that uses MapView. I'm using a library that also uses the Lost API under the hood, and the location updates being requested of that library is crashing MyLocationView:
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6902)
at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:1087)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:5246)
at android.view.View.invalidateInternal(View.java:13573)
at android.view.View.invalidate(View.java:13537)
at android.view.View.invalidate(View.java:13521)
at com.mapbox.mapboxsdk.maps.widgets.MyLocationView$MyLocationShowBehavior.invalidate(MyLocationView.java:851)
at com.mapbox.mapboxsdk.maps.widgets.MyLocationView.update(MyLocationView.java:379)
at com.mapbox.mapboxsdk.maps.widgets.MyLocationView$MarkerCoordinateAnimatorListener.onAnimationUpdate(MyLocationView.java:700)
at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1346)
at android.animation.ValueAnimator.end(ValueAnimator.java:1055)
at com.mapbox.mapboxsdk.maps.widgets.MyLocationView$MyLocationShowBehavior.updateLatLng(MyLocationView.java:833)
at com.mapbox.mapboxsdk.maps.widgets.MyLocationView.setLocation(MyLocationView.java:458)
at com.mapbox.mapboxsdk.maps.widgets.MyLocationView$GpsLocationListener.onLocationChanged(MyLocationView.java:592)
at com.mapbox.mapboxsdk.location.LocationSource.onLocationChanged(LocationSource.java:136)
at com.mapzen.android.lost.internal.LostClientManager.reportLocationChanged(LostClientManager.java:173)
at com.mapzen.android.lost.internal.FusedLocationProviderServiceImpl.reportLocation(FusedLocationProviderServiceImpl.java:126)
at com.mapzen.android.lost.internal.FusionEngine.onLocationChanged(FusionEngine.java:191)
at com.mapzen.android.lost.internal.FusionEngine.checkLastKnownAndNotify(FusionEngine.java:183)
at com.mapzen.android.lost.internal.FusionEngine.checkLastKnownGps(FusionEngine.java:169)
at com.mapzen.android.lost.internal.FusionEngine.enable(FusionEngine.java:119)
at com.mapzen.android.lost.internal.LocationEngine.setRequest(LocationEngine.java:45)
at com.mapzen.android.lost.internal.FusedLocationProviderServiceImpl.requestLocationUpdates(FusedLocationProviderServiceImpl.java:60)
at com.mapzen.android.lost.internal.FusedLocationProviderService.requestLocationUpdates(FusedLocationProviderService.java:69)
at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl
This can be replicated by starting a separate Lost listener on another thread. Here's snippets from a minimal reproducing example (sorry for stuffing all the Lost stuff in one function :-/), based largely off of the example app. The initializeLocation() and initializeMap() calls are basically code from the example app that sets up LocationEngineListener and MapView.
I spin up a new thread and wait a few seconds to let MapView get set up, then I go ahead and register a second Lost listener independent of anything in the Mapbox SDK. When LocationSource.onLocationChanged picks up the updates from this separate thread you should crash and see the stacktrace above.
I'm writing an application that uses MapView. I'm using a library that also uses the Lost API under the hood, and the location updates being requested of that library is crashing MyLocationView:
This can be replicated by starting a separate Lost listener on another thread. Here's snippets from a minimal reproducing example (sorry for stuffing all the Lost stuff in one function :-/), based largely off of the example app. The
initializeLocation()andinitializeMap()calls are basically code from the example app that sets upLocationEngineListenerandMapView.I spin up a new thread and wait a few seconds to let MapView get set up, then I go ahead and register a second Lost listener independent of anything in the Mapbox SDK. When
LocationSource.onLocationChangedpicks up the updates from this separate thread you should crash and see the stacktrace above.