今天在工程添加ExoPlayer依賴時(shí)著洼,報(bào)出錯(cuò)誤“failed to resolve compile 'com.android.support:support-core-utils:25.4.0'”,顯然是找不到這個(gè)依賴了书释,但是本地SDK也不能更新這個(gè)支持庫,Google一番發(fā)現(xiàn)是Google不支持通過SDK的更新來更新support庫了锣光,而是通過maven倉庫來下載支持庫埃撵。原文是這么寫的
The support libraries are now available through Google's Maven repository. We no longer support downloading the libraries through the SDK Manager, and that functionality will be removed soon.
那么具體的添加步驟也很簡單惑畴,跟其他依賴庫相同辐棒。
1.在應(yīng)用的build.gradle文件中添加Google的Maven倉庫地址
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
2.在Module的build.gradle文件中添加依賴引用
dependencies {
...
compile "com.android.support:support-core-utils:25.4.0"
}
Google關(guān)于support庫引用方式的官方鏈接:https://developer.android.com/topic/libraries/support-library/setup.html
stackoverflow上也有類似的問題:https://stackoverflow.com/questions/44691858/failed-to-resolve-com-android-support-design25-4-0