NoClassDefFoundError:android.support.v7.widget.helper.ItemTouchHelper $ 3

时间:2017-07-14 09:03:39

标签: android android-recyclerview

您好我想在RecyclerView上创建滑动删除结果是崩溃:

查看build.gradle,我导入了所有已经重新获得的库。在代码中,我可以使用ItemTouchHelper类,但是当我想要刷一个项目时,它会崩溃。

build.gradle

compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.android.support:support-v13:25.0.0'
compile 'com.android.support:design:25.0.0'

CRASH:

  

致命的例外:主要                                                                                                                                             java.lang.NoClassDefFoundError:android.support.v7.widget.helper.ItemTouchHelper $ 3                                                                                 在android.support.v7.widget.helper.ItemTouchHelper.select(ItemTouchHelper.java:608)                                                                                 在android.support.v7.widget.helper.ItemTouchHelper $ 2.onTouchEvent(ItemTouchHelper.java:389)                                                                                 在android.support.v7.widget.RecyclerView.dispatchOnItemTouch(RecyclerView.java:2519)                                                                                 在android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2662)                                                                                 在android.view.View.dispatchTouchEvent(View.java:9300)                                                                                 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2547)                                                                                 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2240)                                                                                 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)                                                                                 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)                                                                                 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)                                                                                 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)                                                                                 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)                                                                                 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)                                                                                 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)                                                                                 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)                                                                                 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)                                                                                 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)                                                                                 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)                                                                                 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)                                                                                 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)                                                                                 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)                                                                                 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)                                                                                 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)                                                                                 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)                                                                                 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)                                                                                 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)                                                                                 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)                                                                                 在com.android.internal.policy.PhoneWindow $ DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)                                                                                 在com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)                                                                                 在android.app.Activity.dispatchTouchEvent(Activity.java:2771)                                                                                 在android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:67)                                                                                 在android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:67)                                                                                 在com.android.internal.policy.PhoneWindow $ DecorView.dispatchTouchEvent(PhoneWindow.java:2364)                                                                                 在android.view.View.dispatchPointerEvent(View.java:9520)                                                                                 在android.view.ViewRootImpl $ ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4230)                                                                                 在android.view.ViewRootImpl $ ViewPostImeInputStage.onProcess(ViewRootImpl.java:4096)                                                                                 在android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3642)                                                                                 在android.view.ViewRootImpl $ InputStage.onDeliverToNext(ViewRootImpl.java:3695)                                                                                 在android.view.ViewRootImpl $ InputStage.forward(ViewRootImpl.java:3661)                                                                                 在android.view.ViewRootImpl $ AsyncInputStage.forward(ViewRootImpl.java:3787)                                                                                 在android.view.ViewRootImpl $ InputStage.apply(ViewRootImpl.java:3669)                                                                                 在android.view.ViewRootImpl $ AsyncInputStage.apply(ViewRootImpl.java:3844)                                                                                 在android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3642)                                                                                 在android.view.ViewRootImpl $ InputStage.onDeliverToNext(ViewRootImpl.java:3695)                                                                                 在android.view.ViewRootImpl $ InputStage.forward(ViewRootImpl.java:3661)                                                                                 在android.view.ViewRootImpl $ InputStage.apply(ViewRootImpl.java:3669)                                                                                 在android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3642)                                                                                 在android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5922)                                                                                 在android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5896)                                                                                 在android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5857)                                                                               在android.view.ViewRootImpl $ WindowInputEventReceiver.onInputEvent(ViewR

1 个答案:

答案 0 :(得分:4)

几天前面对这个问题。 在我的情况下,它由将所有 cross_entropy = tf.nn.sigmoid_cross_entropy_with_logits(labels=out_layer,logits=y) 依赖项从25.3.1更新为 26.0.0 来修复。并确保他们都使用相同的版本。 希望它会帮助别人。