mapbox / mapbox-gl-native-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
218 stars 114 forks source link

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

Open WrightsCS opened 3 years ago

WrightsCS commented 3 years ago

Environment

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)
india2sarthak commented 3 years ago

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