android-advancedrecyclerview: AnimatorCompatHelper Class Not Found Exception using AppCompat 26.0.0

When using compat library 26.0.0 the app crash when doing Recyclerview Animations

java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHelper;
     at com.h6ah4i.android.widget.advrecyclerview.animator.impl.BaseItemAnimationManager.resetAnimation(BaseItemAnimationManager.java:161)
     at com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator$DefaultItemMoveAnimationManager.addPendingAnimation(RefactoredDefaultItemAnimator.java:312)
     at com.h6ah4i.android.widget.advrecyclerview.animator.GeneralItemAnimator.animateMove(GeneralItemAnimator.java:88)
     at android.support.v7.widget.SimpleItemAnimator.animatePersistence(SimpleItemAnimator.java:140)
     at android.support.v7.widget.RecyclerView$4.processPersistent(RecyclerView.java:543)
     at android.support.v7.widget.ViewInfoStore.process(ViewInfoStore.java:239)
     at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3761)
     at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3419)
     at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3960)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 9
  • Comments: 35 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Hi, guys. Sorry for the inconvenience šŸ™‡

I am going to start working for the new support libraries v26.0.0. Hopefully, I can manage all features work well with the new libraries soon…

I’ve just pushed a new branch which bumps support libraries to v26. I am now working on this branch and its still a pre-stable version.


If you want to try it out now, please add the following jitpack configuration to build.gradle.

repositories {
    maven { url "https://jitpack.io" }
}
dependencies {
    compile 'com.github.h6ah4i:android-advancedrecyclerview:feature~support_libraries_v26-SNAPSHOT'
}

@FredDev06 @SUKI-Huang I’m using develop branch as workaround:

compile 'com.github.h6ah4i:android-advancedrecyclerview:develop-SNAPSHOT'

Any updates on this? Android O just got officially released by the way yesterday, which means we’re still waiting for an official fix on the main branch.

@svenoaks, @devjta, @SUKI-Huang, @tdtran, @AXwjg, @fdonzello

Hi all, sorry for the very late response šŸ™‡

I have just released v0.11.0 today and it includes the fix of this issue, so I am going to close this issue within a few days.


Creating the AnimatorCompatHelper class seems to work but not sure if totally safe. compile ā€˜com.github.h6ah4i:android-advancedrecyclerview:develop-SNAPSHOT’ has weird animation when item is dragged to new position that wasn’t present in older. https://github.com/h6ah4i/android-advancedrecyclerview/issues/425

I am afraid that this might be a regression of the latest release.

I hope this issue would be solved by implementing the new onItemDragStarted() / onItemDragFinished() methods. Please read the following migration guide for more detials. (If you still see the issue with v0.11.0 , please create a new issue report.) Thanks.

Creating the AnimatorCompatHelper class seems to work but not sure if totally safe. compile 'com.github.h6ah4i:android-advancedrecyclerview:develop-SNAPSHOT' has weird animation when item is dragged to new position that wasn’t present in older.

This solution worked for me: https://stackoverflow.com/questions/43320496/noclassdeffounderror-android-support-v4-animation-animatorcompathelper

Added to the bottom of the build.gradle (Module:app):

configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> def requested = details.requested if (requested.group == ā€˜com.android.support’) { if (!requested.name.startsWith(ā€œmultidexā€)) { details.useVersion ā€˜25.4.0’ } } } }

I am about to publish my app in which I used this library. So, I would like to know whether I should wait for its stable release or pre-stable version (feature~support_libraries_v26-SNAPSHOT) is also fine.

@h6ah4i tried it, and still crashing

FATAL EXCEPTION: main
Process: com.huteri.monas, PID: 13689
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHelper;
    at com.h6ah4i.android.widget.advrecyclerview.animator.impl.BaseItemAnimationManager.resetAnimation(BaseItemAnimationManager.java:161)
    at com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator$DefaultItemChangeAnimationManager.addPendingAnimation(RefactoredDefaultItemAnimator.java:220)
    at com.h6ah4i.android.widget.advrecyclerview.animator.GeneralItemAnimator.animateChange(GeneralItemAnimator.java:111)
    at android.support.v7.widget.SimpleItemAnimator.animateChange(SimpleItemAnimator.java:163)
    at android.support.v7.widget.RecyclerView.animateChange(RecyclerView.java:3954)
    at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3753)
    at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3421)
    at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3962)
    at android.view.View.layout(View.java:17523)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
    at android.view.View.layout(View.java:17523)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:17523)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:17523)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
    at android.view.View.layout(View.java:17523)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1172)
    at android.view.View.layout(View.java:17523)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:17523)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:17523)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:17523)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:17523)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at com.android.internal.policy.DecorView.onLayout(DecorView.java:724)
    at android.view.View.layout(View.java:17523)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2342)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2069)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6301)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
    at android.view.Choreographer.doCallbacks(Choreographer.java:683)
    at android.view.Choreographer.doFrame(Choreographer.java:619)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
 Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.animation.AnimatorCompatHelper" on path: DexPathList[[zip file "/data/app/com.huteri.monas-1/base.apk", zip file "/data/app/com.huteri.monas-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.huteri.monas-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.huteri.monas-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.huteri.monas-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.huteri.monas-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.huteri.monas-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.huteri.monas-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.huteri.monas-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.huteri.monas-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.huteri.monas-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.huteri.monas-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.huteri.monas-1/lib/x86, /system/lib, /vendor/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    	... 65 more

and yes, I have cleaned and reinstalled, screen shot 2017-08-09 at 1 27 48 pm

EDIT

Solved with

compile 'com.github.h6ah4i:android-advancedrecyclerview:feature~support_libraries_v26-SNAPSHOT'

I made a pull request with a temporally fix using appcompat 25.3.1

He’s alive!!! Thanks man.

Yeah, was barking at the wrong tree šŸ˜„ Found the error/cultrip for it…

But if you have to wait for external programs + HAVE to use the Android 8.0/Oreo SDK, just create the class with the HoneyCombImplementation:

Create class: android.support.v4.animation.AnimatorCompatHelper

public class AnimatorCompatHelper { private static TimeInterpolator mDefaultInterpolator; public static void clearInterpolator(View view){ if(view != null){ if (mDefaultInterpolator == null) { mDefaultInterpolator = new ValueAnimator().getInterpolator(); } view.animate().setInterpolator(mDefaultInterpolator); } } }

Has this issue of NoClassDefFoundError been fixed?

Same here! The snapshot version with support library 26 does not seem to be available anymore. šŸ˜•

compile 'com.github.h6ah4i:android-advancedrecyclerview:feature~support_libraries_v26-SNAPSHOT'

does not available now ? I got an error this morning

Error:Could not find com.github.h6ah4i:android-advancedrecyclerview:feature~support_libraries_v26-SNAPSHOT.
Required by:
    project :TEST
    Search in build.gradle files