This repository was archived by the owner on Jun 21, 2023. It is now read-only.
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Untraceable Crash: Calling getSourceAs when a newer style is loading/has loaded. #693
Open
Description
Environment
- Android OS version: 9+
- Devices affected: Various
- Maps SDK Version:
'com.mapbox.mapboxsdk:mapbox-android-sdk:9.5.0'
'com.mapbox.mapboxsdk:mapbox-android-gestures:0.7.0'
'com.mapbox.mapboxsdk:mapbox-sdk-services:4.9.0'
'com.mapbox.mapboxsdk:mapbox-android-plugin-markerview-v9:0.4.0'
Observed behavior and steps to reproduce
Firebase is reporting this crash from just about every user. There are no reproducible steps and on each setStyle call we check if style is loaded.
Expected behavior
Don't crash.
Notes / preliminary analysis
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?
Additional links and references
None
Crash Stack Trace
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.onAnimationUpdate(MapboxAnimator.java:93)
at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1566)
at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:692)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:655)
at android.animation.ValueAnimator.start(ValueAnimator.java:1087)
at android.animation.ValueAnimator.start(ValueAnimator.java:1106)
at android.animation.ValueAnimator.startWithoutPulsing(ValueAnimator.java:1099)
at android.animation.AnimatorSet.handleAnimationEvents(AnimatorSet.java:1149)
at android.animation.AnimatorSet.startAnimation(AnimatorSet.java:1234)
at android.animation.AnimatorSet.start(AnimatorSet.java:729)
at android.animation.AnimatorSet.start(AnimatorSet.java:684)
at com.mapbox.mapboxsdk.location.MapboxAnimatorSetProvider.startAnimation(MapboxAnimatorSetProvider.java:31)
at com.mapbox.mapboxsdk.location.LocationAnimatorCoordinator.playAnimators(LocationAnimatorCoordinator.java:395)
at com.mapbox.mapboxsdk.location.LocationAnimatorCoordinator.feedNewCompassBearing(LocationAnimatorCoordinator.java:170)
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)