Could not find com.android.support:appcompat-v7:25.0.0

 

老的Android工程導入as報錯如下:

10:36	Gradle sync failed: Could not find com.android.support:appcompat-v7:25.0.0.
			Required by:
			FuNongTong:app:unspecified (18 s 207 ms)

如果是gradle4.0及以下,增加maven { url "https://maven.google.com" },如下:

buildscript {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

如果是gradle4.0及以上,maven { url "https://maven.google.com" }替換爲google()

如下:

buildscript {
    repositories {
        jcenter()
        google()
    }
    
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

 

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