AviranAbady / CookieBar2

Android library for displaying text messages, notifications and alerts at the top or bottom of the screen. A great alternative for toast and snackbar alerts.
Apache License 2.0
668 stars 74 forks source link

Crash #20

Closed success-0627 closed 4 years ago

success-0627 commented 5 years ago

v 1.1.3

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
        at android.view.ViewGroup.addViewInner(ViewGroup.java:5106)
        at android.view.ViewGroup.addView(ViewGroup.java:4935)
        at android.view.ViewGroup.addView(ViewGroup.java:4875)
        at android.view.ViewGroup.addView(ViewGroup.java:4848)
        at org.aviran.cookiebar2.CookieBar$1.onDismiss(CookieBar.java:105)
        at org.aviran.cookiebar2.CookieBar$1.onDismiss(CookieBar.java:103)
        at org.aviran.cookiebar2.Cookie.cookieListenerDismiss(Cookie.java:318)
        at org.aviran.cookiebar2.Cookie.access$600(Cookie.java:26)
        at org.aviran.cookiebar2.Cookie$3.onAnimationEnd(Cookie.java:293)
        at android.view.animation.Animation.dispatchAnimationEnd(Animation.java:1011)
        at android.view.animation.AnimationSet.getTransformation(AnimationSet.java:397)
        at android.view.animation.Animation.getTransformation(Animation.java:1030)
        at android.view.View.applyLegacyAnimation(View.java:20975)
        at android.view.View.draw(View.java:21091)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4388)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149)
        at android.view.View.draw(View.java:21424)
        at com.android.internal.policy.DecorView.draw(DecorView.java:806)
        at android.view.View.updateDisplayListIfDirty(View.java:20298)
        at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:575)
        at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:581)
        at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:654)
        at android.view.ViewRootImpl.draw(ViewRootImpl.java:3610)
        at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3418)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2755)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1721)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7598)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
        at android.view.Choreographer.doCallbacks(Choreographer.java:790)
        at android.view.Choreographer.doFrame(Choreographer.java:725)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
AviranAbady commented 5 years ago

Thanks @zl910627, will look into it.

success-0627 commented 5 years ago

Hello @AviranAbady You can reproduce error with cookiebars will show continuously in short time. For example, user is chatting in group and other mates sent messages. App will try to show cookiebars, then crash with above exception.

success-0627 commented 5 years ago

Hello @AviranAbady Hope you are doing well. I wonder if there is any update on this issue. Thank you.

AviranAbady commented 5 years ago

Hey @zl910627, I will publish new version over the weekend with a fix included.

AviranAbady commented 5 years ago

@zl910627 Working on it, gotta fix some dismiss issue after fixing the bug.

tamirherman commented 4 years ago

Is there any new things?

AviranAbady commented 4 years ago

@tamirherman @zl910627 yes, issue have been resolved, not yet released. you can expect a release by the end of the week.

baghaii commented 4 years ago

I am having an issue that may be related to either this or the dismiss issue.

  1. Create a two activity app where Activity A launches Activity B.
  2. Have a button on Activity B that launches a CookieBar.
  3. Launch a CookieBar from Activity B.
  4. Hit the back button to return to Activity A before the CookieBar animation is complete.
  5. The app will crash.
AviranAbady commented 4 years ago

@tamirherman @baghaii @zl910627 Version 1.1.4 has been released, addressing the issue you reported.

baghaii commented 4 years ago

Thank you!