Comments (5)
The fix which worked for me: do not reuse the same animator instance across multiple recycler view instances!
I had a static field referring the animator instance. I was creating two instances of the fragment containing the recycler view, but I also noticed the issue when the single fragment instance got recycled and a another instance created.
from recyclerview-animators.
Please your code.
from recyclerview-animators.
For me too when using in fragment.
Code is standard recyclerview in fragment with adapter like here:
https://www.youtube.com/watch?v=MHqpR3yLNfk
11-12 18:58:03.022 26703-26703/de.demoapp.app E/AndroidRuntime: FATAL EXCEPTION: main
11-12 18:58:03.022 26703-26703/de.demoapp.app E/AndroidRuntime: Process: de.demoapp.app, PID: 26703
11-12 18:58:03.022 26703-26703/de.demoapp.app E/AndroidRuntime: java.lang.AbstractMethodError: abstract method "boolean android.support.v7.widget.RecyclerView$ItemAnimator.animateAppearance(android.support.v7.widget.RecyclerView$ViewHolder, android.support.v7.widget.RecyclerView$ItemAnimator$ItemHolderInfo,
.......
from recyclerview-animators.
I also started seeing these occasionally with recyclerview-animators-2.2.3, com.android.support:recyclerview-v7:23.4.0 on Genymotion (Nexus 5 running Android 5.1). As it stands right now, I can't reproduce it :-( Will add more details in case I can. Preventively adding android:focusableInTouchMode="true"
and android:animateLayoutChanges="false"
to my recyclerview, as hinted at from several stackoverflow threads.
This is my stack trace:
06-09 01:00:16.762 20948-20948/com.ebay.napp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.ebay.napp, PID: 20948 java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true at android.support.v7.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:4878) at android.support.v7.widget.RecyclerView.removeAnimatingView(RecyclerView.java:1127) at android.support.v7.widget.RecyclerView.access$6400(RecyclerView.java:147) at android.support.v7.widget.RecyclerView$ItemAnimatorRestoreListener.onAnimationFinished(RecyclerView.java:10294) at android.support.v7.widget.RecyclerView$ItemAnimator.dispatchAnimationFinished(RecyclerView.java:10794) at android.support.v7.widget.SimpleItemAnimator.dispatchRemoveFinished(SimpleItemAnimator.java:265) at jp.wasabeef.recyclerview.animators.BaseItemAnimator$DefaultRemoveVpaListener.onAnimationEnd(BaseItemAnimator.java:690) at android.support.v4.view.ViewPropertyAnimatorCompatJB$1.onAnimationEnd(ViewPropertyAnimatorCompatJB.java:47) at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1116) at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1171) at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:722) at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:738) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:549) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
from recyclerview-animators.
@renyedi Exactly the right answer!
from recyclerview-animators.
Related Issues (20)
- not working in my project HOT 2
- The FlipAnimator on Android-P may cause crashes.
- Blinking after changing item heigth
- Is there a way to animate in this way (video inside)?
- java
- Bug: App does not compile
- FlipInTopXAnimator crashes in Android Pie
- Deleting multiple (50+) items from recycler view is throwing exception (Stacktrace attached) HOT 1
- MultipleBuildFailures error: failed linking references.
- Animation not displaying with data already initialized. HOT 1
- Option to disable the start delay HOT 1
- Help converting to Java HOT 1
- Animation dose not worked HOT 1
- animation not worked properly when i put recyclerview inside nested scrollview HOT 1
- Remove Animation Is Applied To All Items Strange Behaviour HOT 1
- Default ItemAnimators don't use interpolator from constructor
- Add animations work; Remove animations are clunky HOT 2
- Java Settings The following code does not run
- Animator Crashing
- Smooth scroll to first Item befor start animation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recyclerview-animators.