android studio 包重複時過濾引用包
阿新 • • 發佈:2019-02-08
在專案的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'
}
}