Skip to content
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

IllegalStateException #32

Open
achatina opened this issue May 5, 2022 · 1 comment
Open

IllegalStateException #32

achatina opened this issue May 5, 2022 · 1 comment

Comments

@achatina
Copy link

achatina commented May 5, 2022

Hi! Have an exception on the 1.1.5 version:

Fatal Exception: 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:5212)
at android.view.ViewGroup.addView(ViewGroup.java:5035)
at android.view.ViewGroup.addView(ViewGroup.java:4972)
at android.view.ViewGroup.addView(ViewGroup.java:4945)
at org.aviran.cookiebar2.CookieBar$1.onDismiss(CookieBar.java:106)
at org.aviran.cookiebar2.Cookie.cookieListenerDismiss(Cookie.java:325)
at org.aviran.cookiebar2.Cookie.dismiss(Cookie.java:278)
at org.aviran.cookiebar2.Cookie.dismiss(Cookie.java:261)
at org.aviran.cookiebar2.Cookie$5.onAnimationEnd(Cookie.java:401)
at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1111)
at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:554)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1242)
at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1484)
at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1039)
at android.view.Choreographer.doCallbacks(Choreographer.java:860)
at android.view.Choreographer.doFrame(Choreographer.java:781)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1026)
at android.os.Handler.handleCallback(Handler.java:914)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:225)
at android.app.ActivityThread.main(ActivityThread.java:7563)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:994)

Seems like it is related to #20 and #28.
Can't reproduce it by myself, but there are tons of them in our Crashlitycs. Just add a check parent.contains(view) here:
at org.aviran.cookiebar2.CookieBar$1.onDismiss(CookieBar.java:106)

Should probably fix an error. or assert with try-catch

@AviranAbady
Copy link
Owner

Thank you for reporting @achatina
I will take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants