继承推送服务时,根据文档在buildscript和allprojects下添加华为Maven仓库。
repositories {
google()
jcenter()
maven {
url 'http://developer.huawei.com/repo/'
} // HUAWEI Maven repository
}但是,在gradle同步过程中会报告错误。
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not determine artifacts for com.huawei.hms:push:4.0.2.300
Could not get resource 'http://developer.huawei.com/repo/com/huawei/hms/push/4.0.2.300/push-4.0.2.300.aar'.
Could not HEAD 'https://developer.huawei.com/repo/com/huawei/hms/push/4.0.2.300/push-4.0.2.300.aar'.
server certificate change is restricted during renegotiation发布于 2020-06-11 18:07:11
您可以尝试将URL从http更改为https
maven {
url 'https://developer.huawei.com/repo/'
} // HUAWEI Maven repository发布于 2020-06-23 02:14:20
检查您的项目级build.gradle是否如下所示
buildscript {
repositories {
google()
jcenter()
maven {url 'http://developer.huawei.com/repo/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.huawei.agconnect:agcp:1.3.1.300'
}
}
allprojects {
repositories {
google()
jcenter()
maven {url 'http://developer.huawei.com/repo/' }
}
}发布于 2020-06-11 13:53:59
请确保您的网络没有问题。
https://stackoverflow.com/questions/62274474
复制相似问题