-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in sample DrawableAnimations on exiting AnimatedVectorDrawableCompat #61
Comments
Hi @amazingvoice ! |
Hi @shreelakshmijoshi! Just run the demo DrawableAnimations on any android phone or emulator, follow the steps I provided: start the app DrawableAnimations -> click AnimatedVectorDrawableCompat -> click START -> back press before the animation is done, then check the logcat to find the stacktrace, you can set some breakpoints to help you understand how it works. |
The animated fragment is set to null after the animation is completed. When we press the back button , the view gets destroyed but the animated fragment which is bound to the view is still running. We should also destroy the object associated with the view when back button is pressed.
|
@amazingvoice please review my pull request link |
@shreelakshmijoshi Sorry I'm not the maintainer of this project. |
oh okay.. |
@ggfan |
Steps to observe this issue:
start the app DrawableAnimations -> click AnimatedVectorDrawableCompat -> click START -> back press before the animation is done
crash stacktrace:
java.lang.IllegalStateException: Fragment AnimatedFragment{50ea0d2} (32e3cce7-653f-446c-8e11-15e585368791)} did not return a View from onCreateView() or this was called before onCreateView().
at androidx.fragment.app.Fragment.requireView(Fragment.java:1780)
at com.example.android.drawableanimations.demo.animated.AnimatedFragment$$special$$inlined$viewBindings$1.getValue(ViewBindingDelegates.kt:50)
at com.example.android.drawableanimations.demo.animated.AnimatedFragment$$special$$inlined$viewBindings$1.getValue(ViewBindingDelegates.kt:39)
at com.example.android.drawableanimations.demo.animated.AnimatedFragment.getBinding(Unknown Source:2)
at com.example.android.drawableanimations.demo.animated.AnimatedFragment.access$getBinding$p(AnimatedFragment.kt:29)
at com.example.android.drawableanimations.demo.animated.AnimatedFragment$onViewCreated$1.onAnimationEnd(AnimatedFragment.kt:45)
at androidx.vectordrawable.graphics.drawable.Animatable2Compat$AnimationCallback$1.onAnimationEnd(Animatable2Compat.java:86)
at android.graphics.drawable.AnimatedVectorDrawable$2.onAnimationEnd(AnimatedVectorDrawable.java:1021)
at android.graphics.drawable.AnimatedVectorDrawable$VectorDrawableAnimatorRT.onAnimationEnd(AnimatedVectorDrawable.java:1771)
at android.graphics.drawable.AnimatedVectorDrawable$VectorDrawableAnimatorRT.lambda$callOnFinished$0(AnimatedVectorDrawable.java:1778)
at android.graphics.drawable.AnimatedVectorDrawable$VectorDrawableAnimatorRT$$ExternalSyntheticLambda0.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7829)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:982)
The text was updated successfully, but these errors were encountered: