mapbox-gl-native-android icon indicating copy to clipboard operation
mapbox-gl-native-android copied to clipboard

Calling getSourceAs when a newer style is loading/has loaded.

Open WrightsCS opened this issue 3 years ago • 1 comments

Getting way too many crashes from Calling getSourceAs when a newer style is loading/has loaded. None of the stack traces lead back to any thread in my application. There are a few calls to Firebase and other Okhttp sources, but I can't seem to track this one down. All calls to setStyle have a check for Style.OnStyleLoaded and run on the main thread. Any help on where this could be coming from or where I should start tracing again?

Fatal Exception: java.lang.IllegalStateException: Calling getSourceAs when a newer style is loading/has loaded. at com.mapbox.mapboxsdk.maps.Style.validateState(Style.java:786) at com.mapbox.mapboxsdk.maps.Style.getSourceAs(Style.java:148) at com.mapbox.mapboxsdk.location.SymbolLocationLayerRenderer.refreshSource(SymbolLocationLayerRenderer.java:321) at com.mapbox.mapboxsdk.location.SymbolLocationLayerRenderer.setBearingProperty(SymbolLocationLayerRenderer.java:337) at com.mapbox.mapboxsdk.location.SymbolLocationLayerRenderer.setCompassBearing(SymbolLocationLayerRenderer.java:172) at com.mapbox.mapboxsdk.location.LocationLayerController$3.onNewAnimationValue(LocationLayerController.java:286) at com.mapbox.mapboxsdk.location.LocationLayerController$3.onNewAnimationValue(LocationLayerController.java:283) at com.mapbox.mapboxsdk.location.MapboxAnimator.postUpdates(MapboxAnimator.java:106) at com.mapbox.mapboxsdk.location.MapboxAnimator.access$100(MapboxAnimator.java:20) at com.mapbox.mapboxsdk.location.MapboxAnimator$AnimatorListener.onAnimationEnd(MapboxAnimator.java:100) at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:554) at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1250) at android.animation.ValueAnimator.cancel(ValueAnimator.java:1135) at com.mapbox.mapboxsdk.location.LocationAnimatorCoordinator.cancelAnimator(LocationAnimatorCoordinator.java:533) at com.mapbox.mapboxsdk.location.LocationAnimatorCoordinator.createNewFloatAnimator(LocationAnimatorCoordinator.java:353) at com.mapbox.mapboxsdk.location.LocationAnimatorCoordinator.createNewFloatAnimator(LocationAnimatorCoordinator.java:349) at com.mapbox.mapboxsdk.location.LocationAnimatorCoordinator.updateCompassAnimators(LocationAnimatorCoordinator.java:311) at com.mapbox.mapboxsdk.location.LocationAnimatorCoordinator.feedNewCompassBearing(LocationAnimatorCoordinator.java:169) at com.mapbox.mapboxsdk.location.LocationComponent.updateCompassHeading(LocationComponent.java:1577) at com.mapbox.mapboxsdk.location.LocationComponent.access$900(LocationComponent.java:101) at com.mapbox.mapboxsdk.location.LocationComponent$7.onCompassChanged(LocationComponent.java:1714) at com.mapbox.mapboxsdk.location.LocationComponentCompassEngine.notifyCompassChangeListeners(LocationComponentCompassEngine.java:266) at com.mapbox.mapboxsdk.location.LocationComponentCompassEngine.updateOrientation(LocationComponentCompassEngine.java:258) at com.mapbox.mapboxsdk.location.LocationComponentCompassEngine.onSensorChanged(LocationComponentCompassEngine.java:115) at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:996) at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loop(Looper.java:206) at android.app.ActivityThread.main(ActivityThread.java:8506) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

WrightsCS avatar May 05 '21 17:05 WrightsCS

@WrightsCS I'm facing same issue. Have you tried mapbox v9.6.0 yet? I'll update mapbox in the near future on our product. Following commit may be patch for this crash.

https://github.com/mapbox/mapbox-gl-native-android/commit/67eaecefbe4ceaf3475651a0c4a51c1b6ec912ae

rakuishi avatar Jun 07 '21 00:06 rakuishi