升级android studio到3.3版本,今天checkout到历史tag上运行android项目,死活报错
- 之前也有同事遇到过类似的问题
Could not find support-media-compat.aar
最后意外发现是google()仓库位置的问题
报错配置:
allprojects {
repositories {
flatDir {
dirs 'libs'
}
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://dl.bintray.com/thelasterstar/maven/" }
maven {
url "http://maven.aliyun.com/nexus/content/repositories/releases"
}
mavenCentral()
google()
}
configurations.all {
resolutionStrategy {
force "com.android.support:appcompat-v7:$supportLibVersion"
}
}
}
把google()放到第一位即可
allprojects {
repositories {
google()
flatDir {
dirs 'libs'
}
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://dl.bintray.com/thelasterstar/maven/" }
maven {
url "http://maven.aliyun.com/nexus/content/repositories/releases"
}
mavenCentral()
}
configurations.all {
resolutionStrategy {
force "com.android.support:appcompat-v7:$supportLibVersion"
}
}
}