java.lang.NoClassDefFoundError: android.support.v4.animation.AnimatorCompatHelper

at android.support.v7.widget.DefaultItemAnimator.resetAnimation(DefaultItemAnimator.java:514)

       at android.support.v7.widget.DefaultItemAnimator.animateRemove(DefaultItemAnimator.java:188)

       at android.support.v7.widget.SimpleItemAnimator.animateDisappearance(SimpleItemAnimator.java:95)

       at android.support.v7.widget.RecyclerView.animateDisappearance(RecyclerView.java:3252)

       at android.support.v7.widget.RecyclerView.access$700(RecyclerView.java:147)

       at android.support.v7.widget.RecyclerView$4.processDisappeared(RecyclerView.java:431)

       at android.support.v7.widget.ViewInfoStore.process(ViewInfoStore.java:246)


All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 23.4.0. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:recyclerview-v7:23.4.0 less... (Ctrl+F1)

Inspection info:There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion).

解决方案:统一版本,将如下代码加入:build.gradle

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '28.0.0'
            }
        }
    }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.