implementation(name: 'sdk-gp-4.4.4.0', ext: 'aar')
升级android studio到3.3版本,今天checkout到历史tag上运行android项目,死活报错
报错如下:
Could not find support-media-compat.aar
或者如下报错:
ERROR: Failed to resolve: support-media-compat
Affected Modules: app
ERROR: Failed to resolve: support-core-utils
Affected Modules: xxx
ERROR: Failed to resolve: support-compat
Affected Modules: xxxxxx
最后意外发现是google()仓库位置的问题
报错配置:
allprojects {
repositories {
mavenCentral()//如果 jcenter 很慢,尝试添加 mavenCentral 并调整到首行
jcenter()
// maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
maven { url "https://raw.githubusercontent.com/HyphenateInc/Hyphenate-SDK-Android/master/repository" }
google()
}
}
把google()放到第一位即可,build.gread里面有两个repositories,都把google()提到第一行即可
allprojects {
repositories {
google()
mavenCentral()//如果 jcenter 很慢,尝试添加 mavenCentral 并调整到首行
jcenter()
// maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
maven { url "https://raw.githubusercontent.com/HyphenateInc/Hyphenate-SDK-Android/master/repository" }
}
}
repositories {
google()
mavenCentral()//如果 jcenter 很慢,尝试添加 mavenCentral 并调整到首行
jcenter()
maven {
url "https://www.jitpack.io"
}
}