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.

Crash when calling doneLoagingAnimation before start animation ends

See original GitHub issue

When calling doneLoagingAnimation after startAnimation(), but before the start animation has ended, the application crashes on a nullpointer:

Attempt to invoke virtual method 
'void br.com.simplepass.loading_button_lib.animatedDrawables.CircularAnimatedDrawable.stop()' on a null object reference at
br.com.simplepass.loading_button_lib.customViews.CircularProgressButton.doneLoagingAnimation(CircularProgressButton.java:228)

As said, it happens in the following situation:

  • The button starts animating using startAnimation()
  • The loading animation is stopped using doneLoagingAnimation(params) before the initial start animation has ended (button getting narrower)

In my case I’m running an async task that finishes really quick. Because the button depends on its own start animation, this might be an issue that can arise anytime; especially when using wide buttons on tablet and devices get faster in the future.

Another tiny note: is doneLoagingAnimation a typo? (Loaging vs Loading)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
leandroBorgesFerreiracommented, Jan 7, 2019

This problem was corrected prior version 2.0.0. Just tested with a stop and done animation being called before the start animation ends and no problem happens. Fell free to reopen the issue if you still experience this bug.

2reactions
gunhansancarcommented, May 14, 2018

I’m having the same issue on these lines. I’m using the current latest version ‘1.14.0’

Would you mind to add a null check before calling stop in doneLoadingAnimation(int fillColor, Bitmap bitmap) method? It seems it is the easiest solution. In my case also the state changes sometimes very quickly and it crashes on those cases with the below logs.

    java.lang.NullPointerException: Attempt to invoke virtual method 'void br.com.simplepass.loading_button_lib.animatedDrawables.CircularAnimatedDrawable.stop()' on a null object reference
        at br.com.simplepass.loading_button_lib.customViews.CircularProgressButton.doneLoadingAnimation(CircularProgressButton.java:356)
        at br.com.simplepass.loading_button_lib.customViews.CircularProgressButton$6$1.run(CircularProgressButton.java:570)
Read more comments on GitHub >

github_iconTop Results From Across the Web

App crashing because of paused animation and ...
Property animators must either finish animating or be explicitly stopped and finished before they can be released.' Has anyone come across this?
Read more >
Animate crashes on launch or startup - Adobe Support
Solution. To fix Animate crash issues, perform the following troubleshooting tasks: Restore preferences.
Read more >
Crash at end of animation - Spine
Hi, I've an animation (not looping) which have an event at the last key of the animation. I recentely updated the runtime from...
Read more >
Window.requestAnimationFrame() - Web APIs | MDN
This will request that your animation function be called before the ... when requestAnimationFrame() starts to execute callback functions.
Read more >
Property Animation Overview | Android Developers
At the end of 40ms, the animation stops, and the object ends at horizontal position 40. ... When you call start() the animation...
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