1.TransformException: java.util.zip.ZipException: duplicate entry: android/support/design/widget/CoordinatorLayout$1.class
解决办法:
your one of dependency has different version of android support library.force the version in build.gradle root with
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.0.1'
force 'com.android.support:design:27.0.1'
force 'com.android.support:appcompat-v7:27.0.1'
}
}
2.引用第三方出现v4包冲突
compile('com.airbnb.android:lottie:2.5.4') { exclude group: 'com.android.support.v4' }
3.compileSdkVersion与buildToolsVersion引起的问题
No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
Message{kind=ERROR, text=No resource found that matches the given name: attr 'android:keyboardNavigationCluster'., sources=[/Users/chenxiangyu/Frame/syswin1/fuzhoutoon-android/Toon/build/intermediates/data-binding-layout-out/toon/debug/values-v26/values-v26.xml:15:21-54], original message=, tool name=Optional.of(AAPT)}
原先
compileSdkVersion 25
buildToolsVersion "25.0.2"
升级后无误:
compileSdkVersion 27
buildToolsVersion '27.0.3'
博客主要围绕Android开发中的依赖版本冲突问题展开。包括出现TransformException及ZipException提示重复条目,原因是依赖的Android支持库版本不同;还提及引用第三方时v4包冲突,以及compileSdkVersion与buildToolsVersion引发的问题,并给出了在build.gradle root中强制指定版本的解决办法。
336

被折叠的 条评论
为什么被折叠?



