question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StackOverflowError on some devices when using AnimatorListener

See original GitHub issue

This 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:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:19

github_iconTop GitHub Comments

9reactions
KChernenkocommented, Mar 22, 2020

I’m facing the same error.

4reactions
AndroidDeveloperLBcommented, Feb 21, 2022

For those who want an easy way to overcome this, you can just make Lottie ignore this setting completely, using setIgnoreDisabledSystemAnimations(true) in code, or app:lottie_ignoreDisabledSystemAnimations="true" in XML.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found