com.android.support版本沖突解決方法
更新時間:2019年09月12日 15:27:18 作者:tc310
在本篇文章里小編給大家整理的是關(guān)于com.android.support版本沖突解決方法以及相關(guān)知識點,需要的朋友們學(xué)習(xí)下。
項目中不同Module的support包版本沖突怎么辦?
只需要將以下代碼復(fù)制到每個模塊的build.gradle(Module:xxx)文件的根目錄即可:
// 統(tǒng)一當(dāng)前Module的所有support包版本
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '28.0.0'
}
}
}
}
模板代碼如下:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
...
}
buildTypes {
...
}
lintOptions {
...
}
}
dependencies {
...
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '28.0.0'
}
}
}
}
以上就是相關(guān)全部知識點內(nèi)容,感謝大家的學(xué)習(xí)和對腳本之家的支持。
相關(guān)文章
關(guān)于Android?Webview?設(shè)置Cookie問題詳解
大家好,本篇文章是關(guān)于Android?Webview?設(shè)置Cookie問題詳解,感興趣的同學(xué)可以看看,希望對你起到幫助,有用的話記得收藏,方便下次瀏覽2021-11-11
Android手機獲取root權(quán)限并實現(xiàn)關(guān)機重啟功能的方法
這篇文章主要介紹了Android手機獲取root權(quán)限并實現(xiàn)關(guān)機重啟功能的方法,是Android程序設(shè)計中非常重要的技巧,需要的朋友可以參考下2014-08-08
Android內(nèi)容提供者ContentProvider用法實例分析
這篇文章主要介紹了Android內(nèi)容提供者ContentProvider用法,結(jié)合實例形式較為詳細(xì)的分析了內(nèi)容提供者ContentProvider獲取及解析數(shù)據(jù)的相關(guān)技巧,需要的朋友可以參考下2016-03-03
Android編程ProgressBar自定義樣式之動畫模式實現(xiàn)方法
這篇文章主要介紹了Android編程ProgressBar自定義樣式之動畫模式實現(xiàn)方法,涉及Android動畫模式的布局技巧,非常具有實用價值,需要的朋友可以參考下2015-10-10

