android/support/v4/hardware/display/DisplayManagerCompat$JellybeanMr1Impl.class
来源:互联网 发布:德川家光 知乎 编辑:程序博客网 时间:2024/06/05 02:20
题引:同事需要使用第三方库,由于这些第三方库使用的v4包版本跟我们编写的项目所使用的v4包版本不同而导致了一个bug(duplicate entry) 。
- 引入recyclerview-swipe
- 引入butterknife
- bug来了
- Instant Run
某同事引入recyclerview-swipe和butterknife
compile 'com.yanzhenjie:recyclerview-swipe:1.0.2'compile 'com.jakewharton:butterknife:8.5.1'
bug来了
* What went wrong:Execution failed for task ':yangsheng:transformClassesWithJarMergingForDebug'.> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/hardware/display/DisplayManagerCompat$JellybeanMr1Impl.class
奇怪的是,其他同事并没有报错!!!
Instant Run
最终发现同事没有报错是因为开启了Instant Run,因为Instant Run会自动过滤包冲突。
解决思路
刚开始,以为是引入recyclerview-swipe导致的,因为recyclerview-swipe使用的v4包跟我们项目使用的v4包版本不同。修改gradle如下:
compile('com.yanzhenjie:recyclerview-swipe:1.0.2') { exclude module: 'recyclerview-v7'}
然而并没有什么卵用!!!
终于发现问题了,是引入butterknife导致的bug,gradle修改如下:
compile('com.jakewharton:butterknife:8.5.1') { exclude module: 'support-compat'}
最终编译成功通过并且能够安装运行。
0 0
- android/support/v4/hardware/display/DisplayManagerCompat$JellybeanMr1Impl.class
- android/support/v4/text/TextUtilsCompat.class异常
- Error inflating class android.support.v4.view.ViewPaper
- Error inflating class android.support.v4.view.ViewPager问题解决
- Could not find class 'android.support.v4.widget.EdgeEffectCompat',
- Didn't find class "android.support.v4.animation.AnimatorCompatHelper"
- Didn't find class "android.support.v4.animation.AnimatorCompatHelper
- android.support.v4
- Android support V4 package
- android support v4包
- Android Support V4是什么?
- android-support-v4-preferencefragment
- android-support-v4
- Android异常:could not find class android.support.v4.view.ViewPager
- Android 使用viewpager时报Didn't find class "android.support.v4.view.Viewpager"错误
- Android程序编译时报错:duplicate entry: android/support/v4/content/res/TypedArrayUtils.class
- android项目build问题 duplicate entry :android/support/v4/widget/ViewDragHelper$callback.class
- 关于 android-support-v4.jar
- 链表程序.c
- Rails高级路由知识:手动为路由创建名称
- base64_encode +号变空格
- linux下的基本操作03(系统命令)
- cpp——与c之不同——struct union
- android/support/v4/hardware/display/DisplayManagerCompat$JellybeanMr1Impl.class
- Qt 5学习(二)QML
- Unity的50个使用技巧
- C++ — new和delete的总结
- cpp——与c之不同——函数
- Rails高级路由知识:手动为路由创建名称
- kafka权威指南中文翻译之一
- LeetCode | 463. Island Perimeter
- linux操作系统-小知识点总结1