android 項目編譯報Failed to resolve: support-core-utils 解決

在編譯新的項目的時候,項目報Failed to resolve: support-core-utils 異常。

這是由於項目編譯不能找到這個庫,查詢資料後發現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、在應用的build.gradle文件中添加Google的maven倉庫地址

allprojects {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()
        
    }
}

2、在項目module的build.gradle文件中添加依賴引用

dependencies {
    
//    //Failed to resolve: support-core-utils
    implementation "com.android.support:support-core-utils:26.1.0"
}

 

Google關於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

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章