android studio 包重复时过滤引用包

在项目的build.gradle中加载时过滤掉会重复的库

dependencies {
compile fileTree(include: [‘*.jar’], dir: ‘libs’)
androidTestCompile(‘com.android.support.test.espresso:espresso-core:2.2.2’, {
exclude group: ‘com.android.support’, module: ‘support-annotations’
})
compile ‘com.android.support:appcompat-v7:25.2.0’
compile ‘com.android.support.constraint:constraint-layout:1.0.2’
testCompile ‘junit:junit:4.12’
//此处重点:加载xstream解析库并过滤xmlpull,此包android系统api中已经存在
compile ('com.thoughtworks.xstream:xstream:1.4.7'){
exclude group: 'xmlpull'
}

}

你可能感兴趣的:(Android应用开发)