在将Android Studio更新到2.3版本后,每次我滑动ViewPager时,都会出现此错误并导致应用程序崩溃:
03-23 17:19:19.437 28523-28523/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.irokotv.plus, PID: 28523
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHelper;
at android.support.v7.widget.DefaultItemAnimator.resetAnimation(DefaultItemAnimator.java:515)
at android.support.v7.widget.DefaultItemAnimator.animateAdd(DefaultItemAnimator.java:218)
at android.support.v7.widget.SimpleItemAnimator.animateAppearance(SimpleItemAnimator.java:114)
at android.support.v7.widget.RecyclerView.animateAppearance(RecyclerView.java:3528)
at android.support.v7.widget.RecyclerView$4.processAppeared(RecyclerView.java:461)
at android.support.v7.widget.ViewInfoStore.process(ViewInfoStore.java:249)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3385)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3135)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3568)
at android.view.View.layout(View.java:18793)
at android.view.ViewGroup.layout(ViewGroup.java:5952)
at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1766)
at android.view.View.layout(View.java:18793)
at android.view.ViewGroup.layout(ViewGroup.java:5952)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1364)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:846)
at android.view.View.layout(View.java:18793)
at android.view.ViewGroup.layout(ViewGroup.java:5952)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:18793)
at android.view.ViewGroup.layout(ViewGroup.java:5952)
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:18793)
at android.view.ViewGroup.layout(ViewGroup.java:5952)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:18793)
at android.view.ViewGroup.layout(ViewGroup.java:5952)
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:18793)
at android.view.ViewGroup.layout(ViewGroup.java:5952)
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:818)
at android.view.View.layout(View.java:18793)
at android.view.ViewGroup.layout(ViewGroup.java:5952)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2615)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2331)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1490)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7027)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
at android.view.Choreographer.doCallbacks(Choreographer.java:702)
at android.view.Choreographer.doFrame(Choreographer.java:638)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
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:6688)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
更新之前这个应用程序运行良好。我已经清理了项目、使缓存无效,还使用了gradle clean命令。不知道我还能做/尝试什么。我的同事可以构建这个项目,而且没有任何问题。
AnimatorCompatHelper
类)。有任何红线吗? - snachmsmbuild.gradle
文件。 - azizbekian