StackOverflowError on some devices when using AnimatorListener
See original GitHub issueThis bug occurs only on some devices. I can’t reproduce it on my devices, but I see it in crash reports.
java.lang.StackOverflowError:
at com.airbnb.lottie.animation.keyframe.BaseKeyframeAnimation.setProgress (BaseKeyframeAnimation.java:54)
at com.airbnb.lottie.animation.keyframe.TransformKeyframeAnimation.setProgress (TransformKeyframeAnimation.java:124)
at com.airbnb.lottie.model.layer.BaseLayer.setProgress (BaseLayer.java:519)
at com.airbnb.lottie.model.layer.CompositionLayer.setProgress (CompositionLayer.java:147)
at com.airbnb.lottie.LottieDrawable$1.onAnimationUpdate (LottieDrawable.java:74)
at com.airbnb.lottie.utils.BaseLottieAnimator.notifyUpdate (BaseLottieAnimator.java:88)
at com.airbnb.lottie.utils.LottieValueAnimator.setFrame (LottieValueAnimator.java:159)
at com.airbnb.lottie.utils.LottieValueAnimator.playAnimation (LottieValueAnimator.java:208)
at com.airbnb.lottie.LottieDrawable.playAnimation (LottieDrawable.java:420)
at com.airbnb.lottie.LottieAnimationView.playAnimation (LottieAnimationView.java:549)
at com.myetherwallet.mewwalletui.feature.main.util.LottieHelper$Companion$loopSegment$1.onAnimationEnd (LottieHelper.kt:86)
at android.animation.Animator$AnimatorListener.onAnimationEnd (Animator.java:552)
at com.airbnb.lottie.utils.BaseLottieAnimator.notifyEnd (BaseLottieAnimator.java:73)
at com.airbnb.lottie.utils.LottieValueAnimator.endAnimation (LottieValueAnimator.java:217)
at com.airbnb.lottie.LottieDrawable.playAnimation (LottieDrawable.java:424)
at com.airbnb.lottie.LottieAnimationView.playAnimation (LottieAnimationView.java:549)
Device list:
Sony Xperia XZ3 (SOV39), 3840MB RAM, Android 9
Motorola Moto X (4) (payton), 2816MB RAM, Android 9
Huawei HUAWEI Y9 Prime 2019 (HWSTK-HF), 3840MB RAM, Android 10
Samsung Galaxy S8 (dreamlte), 3840MB RAM, Android 9
Xiaomi MI 8 Lite (platina), 3840MB RAM, Android 9
ZTE Z717VL (lavender), 1024MB RAM, Android 9
Samsung Galaxy S10 5G (beyondx), 7424MB RAM, Android 10
Bug was occured several times on each device from this list.
I replaced onAnimationEnd with Handler.postDelayed and handle animation end by time. It works well on all of devices. But this is not a correct way.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:19
Top Results From Across the Web
android cancel animation cause stackoverflow error
i am trying to use animation to zoom image ...
Read more >StackOverflowError - Android Developers
Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object, or some other...
Read more >Determinants of quality, latency, and amount of Stack Overflow ...
Some potential outcomes are: increased quality of answers, reduced time until a quality answer, attracting people who can answer difficult ...
Read more >Diff - platform/frameworks/base - Google Git
+ * Called after the user has failed at entering their device or profile challenge password, + * as a result of receiving...
Read more >Event listener hooks for AnimatedVectorDrawable [37031255]
https://stackoverflow.com/questions/28812604/is-there-a-way-to-listen-for- ... AnimatorListener on the AnimatedVectorDrawable and get events that way.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m facing the same error.
For those who want an easy way to overcome this, you can just make Lottie ignore this setting completely, using
setIgnoreDisabledSystemAnimations(true)
in code, orapp:lottie_ignoreDisabledSystemAnimations="true"
in XML.