shineM / TreeView

An android tree structure view with high performance and rich features
Apache License 2.0
470 stars 95 forks source link

I got NoClassDefFoundError when clicking the items #11

Closed figobbq closed 7 years ago

figobbq commented 7 years ago

java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHelper; at me.texy.treeview.animator.DefaultItemAnimator.resetAnimation(DefaultItemAnimator.java:520) at me.texy.treeview.animator.DefaultItemAnimator.animateMove(DefaultItemAnimator.java:256) at android.support.v7.widget.SimpleItemAnimator.animatePersistence(SimpleItemAnimator.java:126) at android.support.v7.widget.RecyclerView$4.processPersistent(RecyclerView.java:504) at android.support.v7.widget.ViewInfoStore.process(ViewInfoStore.java:241) at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3444) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3194) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3627)

shineM commented 7 years ago

I guess this is caused by SDK version .Plz paste your defaultConfig or you can try this : add android { lintOptions { disable 'RestrictedApi' } } to your app's build.gradle

figobbq commented 7 years ago

are you Chinese? 解决了,是support v4包的版本问题,其中一个模块用了compile 'com.android.support:support-v4:+', 改成compile 'com.android.support:support-v4:25.3.1'就好了

figobbq commented 7 years ago

另外想问一下,怎么设置每个item的长按事件?

shineM commented 7 years ago

OK。我看你用英文我以为你是老外😂

shineM commented 7 years ago

item长按可以在bindView中 调itemView.setOnLongClickListener();

figobbq commented 7 years ago

噢,我见你没回复,然后开了新issue

manimaran96 commented 6 years ago

lintOptions { disable 'RestrictedApi' }

not worked