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

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

Open WrightsCS opened this issue 4 years ago • 1 comments

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)

WrightsCS avatar May 12 '21 00:05 WrightsCS

Any updates on this? Facing the same crash in 9.5.0 as well.

india2sarthak avatar Aug 25 '21 05:08 india2sarthak