android RecyclerView:failed resolution of Landroid/support/v4/animation/AnimatorCompatHelper

记一个小错误,在使用RecyclerView的默认Animator的时候,点动画的时候会奔溃,而且没有具体到哪一行代码,看到了标题的报错。查了下是多个版本造成的冲突,所以将build.gradle的RecyclerView的版本修改成support:appcompat的版本号就没出问题了

发布了54 篇原创文章 · 获赞 48 · 访问量 10万+
展开阅读全文

android的LocationBroadcastManager的包资源配置问题,求指教!

10-17

一开始,我创建一个LocationBroadcastManager的变量,结果系统库里识别不了这个类 ![图片说明](https://img-ask.csdn.net/upload/201610/17/1476681057_620065.png) 然后我就上网,看到别人说的解决方法说是:因为没有导入android.support.v4.conten这个包;然后我就按提示导入了support-v4-19.1.0.jar![图片说明](https://img-ask.csdn.net/upload/201610/17/1476681645_561409.png) 之后就没有报错了,但是在运行的时候,又报错,下面是Log: 10-17 01:35:26.788: E/AndroidRuntime(5555): FATAL EXCEPTION: main 10-17 01:35:26.788: E/AndroidRuntime(5555): Process: com.example.broadcastreceive, PID: 5555 10-17 01:35:26.788: E/AndroidRuntime(5555): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/LocalBroadcastManager; 10-17 01:35:26.788: E/AndroidRuntime(5555): at com.example.broadcastreceive.MainActivity.onCreate(MainActivity.java:34) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.Activity.performCreate(Activity.java:5990) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.ActivityThread.access$800(ActivityThread.java:151) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.os.Handler.dispatchMessage(Handler.java:102) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.os.Looper.loop(Looper.java:135) 10-17 01:35:26.788: E/AndroidRuntime(5555): at android.app.ActivityThread.main(ActivityThread.java:5254) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.reflect.Method.invoke(Native Method) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.reflect.Method.invoke(Method.java:372) 10-17 01:35:26.788: E/AndroidRuntime(5555): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 10-17 01:35:26.788: E/AndroidRuntime(5555): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 10-17 01:35:26.788: E/AndroidRuntime(5555): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.LocalBroadcastManager" on path: DexPathList[[zip file "/data/app/com.example.broadcastreceive-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]] 10-17 01:35:26.788: E/AndroidRuntime(5555): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.ClassLoader.loadClass(ClassLoader.java:469) 10-17 01:35:26.788: E/AndroidRuntime(5555): ... 14 more 10-17 01:35:26.788: E/AndroidRuntime(5555): Suppressed: java.lang.ClassNotFoundException: android.support.v4.content.LocalBroadcastManager 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.Class.classForName(Native Method) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.BootClassLoader.findClass(ClassLoader.java:781) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) 10-17 01:35:26.788: E/AndroidRuntime(5555): at java.lang.ClassLoader.loadClass(ClassLoader.java:504) 10-17 01:35:26.788: E/AndroidRuntime(5555): ... 15 more 10-17 01:35:26.788: E/AndroidRuntime(5555): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available 10-17 01:37:34.075: E/AndroidRuntime(5631): FATAL EXCEPTION: main 10-17 01:37:34.075: E/AndroidRuntime(5631): Process: com.example.broadcastreceive, PID: 5631 10-17 01:37:34.075: E/AndroidRuntime(5631): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/LocalBroadcastManager; 10-17 01:37:34.075: E/AndroidRuntime(5631): at com.example.broadcastreceive.MainActivity.onCreate(MainActivity.java:34) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.Activity.performCreate(Activity.java:5990) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.ActivityThread.access$800(ActivityThread.java:151) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.os.Handler.dispatchMessage(Handler.java:102) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.os.Looper.loop(Looper.java:135) 10-17 01:37:34.075: E/AndroidRuntime(5631): at android.app.ActivityThread.main(ActivityThread.java:5254) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.reflect.Method.invoke(Native Method) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.reflect.Method.invoke(Method.java:372) 10-17 01:37:34.075: E/AndroidRuntime(5631): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 10-17 01:37:34.075: E/AndroidRuntime(5631): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 10-17 01:37:34.075: E/AndroidRuntime(5631): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.LocalBroadcastManager" on path: DexPathList[[zip file "/data/app/com.example.broadcastreceive-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]] 10-17 01:37:34.075: E/AndroidRuntime(5631): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.ClassLoader.loadClass(ClassLoader.java:469) 10-17 01:37:34.075: E/AndroidRuntime(5631): ... 14 more 10-17 01:37:34.075: E/AndroidRuntime(5631): Suppressed: java.lang.ClassNotFoundException: android.support.v4.content.LocalBroadcastManager 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.Class.classForName(Native Method) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.BootClassLoader.findClass(ClassLoader.java:781) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) 10-17 01:37:34.075: E/AndroidRuntime(5631): at java.lang.ClassLoader.loadClass(ClassLoader.java:504) 10-17 01:37:34.075: E/AndroidRuntime(5631): ... 15 more 10-17 01:37:34.075: E/AndroidRuntime(5631): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available 这个Log不是很看得懂,但是发现java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/LocalBroadcastManager; 说是找不到我导入的那个类,于是我在应用库里找,但是能够看到这个类 ![图片说明](https://img-ask.csdn.net/upload/201610/17/1476682996_496913.png) 但是点进这个类,却出现Failed to create the part's controls![图片说明](https://img-ask.csdn.net/upload/201610/17/1476683131_13356.png) 之后我就不知道该怎么继续找问题了,有没有大神能指教一下!!!!!新手自学不容易:( 问答

NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHelper;

10-24

最近想买一直报这个问题 希望有大神帮我解决一下 导致崩溃 在多种地方都会显示这个错误 也没有提示哪行带拿错了 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:3804) at android.support.v7.widget.RecyclerView$4.processAppeared(RecyclerView.java:521) at android.support.v7.widget.ViewInfoStore.process(ViewInfoStore.java:247) at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3653) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3323) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3844) at android.view.View.layout(View.java:16673) at android.view.ViewGroup.layout(ViewGroup.java:5476) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16673) at android.view.ViewGroup.layout(ViewGroup.java:5476) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16673) at android.view.ViewGroup.layout(ViewGroup.java:5476) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1732) at android.widget.LinearLayout.onLayout(LinearLayout.java:1497) at android.view.View.layout(View.java:16673) at android.view.ViewGroup.layout(ViewGroup.java:5476) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16673) at android.view.ViewGroup.layout(ViewGroup.java:5476) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16673) at android.view.ViewGroup.layout(ViewGroup.java:5476) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16673) at android.view.ViewGroup.layout(ViewGroup.java:5476) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16673) at android.view.ViewGroup.layout(ViewGroup.java:5476) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2727) at android.view.View.layout(View.java:16673) at android.view.ViewGroup.layout(ViewGroup.java:5476) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2304) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2033) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1209) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6330) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:862) at android.view.Choreographer.doCallbacks(Choreographer.java:674) at android.view.Choreographer.doFrame(Choreographer.java:610) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:848) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loo 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览