1. 程式人生 > >com.android.support版本衝突的解決辦法

com.android.support版本衝突的解決辦法

強制使用當前專案module的依賴包,捨棄亂七八糟的第三方依賴,在專案層級app層的build.gradle(最外層新增就好)中新增如下程式碼:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion cfgs.androidSupportVersion
            }
        }
    }
}

親測有用!!!!