Closed jordyamc closed 6 years ago
Hi, thanks for the report. I guess there are a lot of more incompatibilities exist because the support library v26 has changed its min SDK to API level 14. Also, I am going to change the min SDK level of this library when after non-beta version of support library v26 is released.
I made a pull request with a temporally fix using appcompat 25.3.1
Also i use Appcompat 26.0.0-beta2 in my app and i have no problems with Drag/Drop, Swipe, and Expand/Collapse using my fix :D
I'm seeing this issue with the stable release of AppCompat 26.0.0 too.
Would be good to have this fix out please
I have got the same crash with stable release of Support Library 26.0.0
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'
}
@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,
EDIT
Solved with
compile 'com.github.h6ah4i:android-advancedrecyclerview:feature~support_libraries_v26-SNAPSHOT'
@huteri Thanks for your clarification. I forgot to change the commit ID π
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.
Please, give us more information about when this library will be updated, Thank you.
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.
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' } } } }
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
Same here! The snapshot version with support library 26 does not seem to be available anymore. :/
@FredDev06 @SUKI-Huang I'm using develop branch as workaround:
compile 'com.github.h6ah4i:android-advancedrecyclerview:develop-SNAPSHOT'
Has this issue of NoClassDefFoundError been fixed?
nope.. still there in develop-SNAPSHOT
The solution is to add the following code block to your 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 '24.1.0' } } } }
wrong project ;-)
FWIW I use the snapshot version in production and it works perfectly well for users of my apps
Yeah, was barking at the wrong tree :D 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); } } }
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.
I got same issue with @svenoaks
Well all I did was looking at the sources of AnimatorCompatHelper and replaced its behavior. Original code: https://android.googlesource.com/platform/frameworks/support/+/e1e957f/v4/java/android/support/v4/animation/AnimatorCompatHelper.java And the impl of the animator: https://github.com/phhusson/SafetyNet/blob/master/android/support/v4/animation/HoneycombMr1AnimatorCompatProvider.java
h6ah4i replaced it the same way I did it..
I used that trick in that project: https://github.com/muditsen/multilevelrecyclerview/pull/5 and the recyclerview works fine. But if you have problems, maybe the problem could also be there.. So it would be really nice to know, how it was changed in the snapshot.
If you create the AnimatorCompatHelper class, you dont need the develop-branch!! The devleop-branch got rid of the class and instead uses this here (decompiled from the develop-lib)
protected void resetAnimation(RecyclerView.ViewHolder holder) {
if (sDefaultInterpolator == null) {
sDefaultInterpolator = new ValueAnimator().getInterpolator();
}
holder.itemView.animate().setInterpolator(sDefaultInterpolator);
endAnimation(holder);
}
Which is kinda the same, you will see in the HoneycombMr1AnimatorCompatProvider.java or at my post 2 days ago.
So again with the develop version, you dont need to create the CompatHelper class. You can use the stable version and add the CompatHelper class.
But both things uses the same methods.. So if the animations are not working, I cannot help you at all.. Just try the NOT-develop version/Stable version with the AnimatorCompatHelper and see if it works..
@devjta thanks for your help I don't have problems with your class and I am using the stable branch, I'm just worried that there might be other incompatibilities with library 26 besides this obvious one if it is used in production.
I am developing for a week with the 26sdk + support (v4 and v7) now and everything looks quite good.
There were some changes for Notifiation-stuff (you need a channel now) and background-services are limited now. But these change just happens on Android 8 devices..
@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.
He's alive!!! Thanks man.
the solutation all use old version , @h6ah4i how u fix the problem without AnimatorCompatHelper? I can`t find where I use it , select none result in my project , so can u tell me how to find where I use it then fix it.
Even after shifting to 25.3.1 it causing a crash. No previously mentioned tricks working. Please help.
The solution many use, is what I posted at 25th October.. Just create the class and implement the method like it was in Android sdk. Or the project-owner remove any use of the AnimatorCompatHelper (also includes, etc.) and uses his own animation or copy the impl from Android.
I am using buildtoolVersion 26.0.2 and targetSdkVersion 26.0.2 . Using library Expandablelayout which is using AnimatorCompatHelper. I crashing saying java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHelper;
Please help me out with this...can't remove this lib
When using compat library 26.0.0 the app crash when doing Recyclerview Animations