花了整整一上午時間終于找到了解決辦法打颤。
如果是“Could not find support-v4.aar”的錯誤部蛇,也可以試試這個方案嗦嗡。
解決方案:找到項目的build.gradle文件缭保,在buildscript里的repositories里新建一條
maven { url 'https://maven.google.com' }
確保它位于 jcenter()的上方!!蘸朋,之后重新build項目就可以了掸犬。
舉例:
buildscript {
ext.kotlin_version = '1.2.41'
repositories {
maven { url 'https://maven.google.com' }
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
maven { url 'https://maven.google.com' }
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}