无法解析 com.huawei.hms:network-common:4.0.0.302

Could not resolve com.huawei.hms:network-common:4.0.0.302

* What went wrong:
A problem occurred configuring project .
> Could not resolve all dependencies for configuration ':mishop2client:GooglePlayDebugCompileClasspath'.
   > Could not resolve com.huawei.hms:network-common:4.0.0.302.
     Required by:
         project :mishop2client
      > Could not resolve com.huawei.hms:network-common:4.0.0.302.
         > Could not get resource 'https://dl.bintray.com/thelasterstar/maven/com/huawei/hms/network-common/4.0.0.302/network-common-4.0.0.302.pom'.
            > Could not HEAD 'https://dl.bintray.com/thelasterstar/maven/com/huawei/hms/network-common/4.0.0.302/network-common-4.0.0.302.pom'. Received status code 504 from server: Gateway Time-out
   > Could not resolve com.huawei.hms:network-common:4.0.0.302.
     Required by:
         project :mishop2client > com.huawei.hms:network-grs:4.0.0.302
      > Could not resolve com.huawei.hms:network-common:4.0.0.302.
         > Could not get resource 'https://dl.bintray.com/thelasterstar/maven/com/huawei/hms/network-common/4.0.0.302/network-common-4.0.0.302.pom'.
            > Could not HEAD 'https://dl.bintray.com/thelasterstar/maven/com/huawei/hms/network-common/4.0.0.302/network-common-4.0.0.302.pom'. Received status code 504 from server: Gateway Time-out

集成推送服务时一直报该错误。我该怎么办?

  1. 建议您整合latest version of the Push Kit。目前最新版本为6.1.0.300.

  2. 建议检查网络configuration.ThisMaven无法下载出现错误。主要原因是网络不好或受限。例如,防火墙不允许您访问华为网站。

你的日志中的maven地址好像不对,请将maven替换到华为的仓库中,建议把地址放在最后:

repositories {
    google()
    jcenter()    
    maven { url 'https://developer.huawei.com/repo/' }
}