Process: ax.synt.dropexpress_client_app, PID: 9015
java.lang.IllegalStateException: Calling getSourceAs when a newer style is loading/has loaded.
at com.mapbox.mapboxsdk.maps.Style.validateState(Style.java:522)
at com.mapbox.mapboxsdk.maps.Style.getSourceAs(Style.java:132)
at com.mapbox.mapboxsdk.location.LocationLayerController.refreshSource(LocationLayerController.java:291)
at com.mapbox.mapboxsdk.location.LocationLayerController.setBearingProperty(LocationLayerController.java:273)
at com.mapbox.mapboxsdk.location.LocationLayerController.access$100(LocationLayerController.java:61)
at com.mapbox.mapboxsdk.location.LocationLayerController$3.onNewAnimationValue(LocationLayerController.java:437)
at com.mapbox.mapboxsdk.location.LocationLayerController$3.onNewAnimationValue(LocationLayerController.java:434)
at com.mapbox.mapboxsdk.location.MapboxAnimator.postUpdates(MapboxAnimator.java:83)
at com.mapbox.mapboxsdk.location.MapboxAnimator.onAnimationUpdate(MapboxAnimator.java:71)
at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1374)
at android.animation.ValueAnimator.animationFrame(ValueAnimator.java:1298)
at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1339)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:715)
at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:738)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:800)
at android.view.Choreographer.doCallbacks(Choreographer.java:603)
at android.view.Choreographer.doFrame(Choreographer.java:571)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:786)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5637)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
@JobGetabu this exception is expected. You need to wait for a full style load before manipulating it contents. This can be done by adding a listener to your setStyle invocation or by added a style load listener to MapView. Without seeing additional code, I can't give more pointers as this. Closing as work as designed.
How did you solve the problem?
I had missed onStop method overload...
Most helpful comment
@JobGetabu this exception is expected. You need to wait for a full style load before manipulating it contents. This can be done by adding a listener to your setStyle invocation or by added a style load listener to MapView. Without seeing additional code, I can't give more pointers as this. Closing as work as designed.