无法解析 com.huawei.agconnect:agcp:1.6.0.300
Posted
技术标签:
【中文标题】无法解析 com.huawei.agconnect:agcp:1.6.0.300【英文标题】:Could not resolve com.huawei.agconnect:agcp:1.6.0.300 【发布时间】:2022-01-07 19:03:44 【问题描述】:需要帮助如何解决 HMS SDK 的问题。
> Could not get resource
> 'https://dl.bintray.com/android/android-tools/com/huawei/agconnect/agcp/1.6.0.300/agcp-1.6.0.300.pom'.
> > Could not GET 'https://dl.bintray.com/android/android-tools/com/huawei/agconnect/agcp/1.6.0.300/agcp-1.6.0.300.pom'.
> Received status code 502 from server: Bad Gateway
build.gradle:
repositories
google()
jcenter()
maven url 'https://dl.bintray.com/android/android-tools'
maven url 'https://developer.huawei.com/repo/'
【问题讨论】:
【参考方案1】:从服务器收到状态码 502:Bad Gateway
这可能是因为 gradle 处于离线模式或当前网络受限。因此,建议您检查 gradle 配置和网络设置。
buildscript
repositories
google()
jcenter()
// Configure the Maven repository address for the HMS Core SDK.
maven url 'https://developer.huawei.com/repo/'
dependencies
...
// Add the AppGallery Connect plugin configuration. You are advised to use the latest plugin version.
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
allprojects
repositories
google()
jcenter()
// Configure the Maven repository address for the HMS Core SDK.
maven url 'https://developer.huawei.com/repo/'
关于如何配置build.gradle文件,请参考this。
【讨论】:
现在可以正常使用了,好像是网络问题【参考方案2】:取自这里
Could not find com.huawei.agconnect:agcp:1.0.0.300
“您好像错过了添加应用程序 gradle 配置。
在您的 gradle 文件中添加这些行后尝试
buildscript
repositories
maven url 'http://developer.huawei.com/repo/'
dependencies
classpath 'com.huawei.agconnect:agcp:1.2.0.300'
allprojects
repositories
maven url 'http://developer.huawei.com/repo/'
"
或者那里的其他选项之一..
【讨论】:
以上是关于无法解析 com.huawei.agconnect:agcp:1.6.0.300的主要内容,如果未能解决你的问题,请参考以下文章