3

When inheriting the push service, add Huawei Maven repository under buildscript and allprojects according to the document.

repositories {
    google()
    jcenter()
    maven {
        url 'http://developer.huawei.com/repo/'
    } // HUAWEI Maven repository
}

However, an error is reported during gradle synchronization.

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
deadfish
  • 11,996
  • 12
  • 87
  • 136
  • I can resolve that import without any problem. Make sure your proxy is not blocking these requests or it could be that the repo is down temporarily for maintenance. – m0skit0 Jun 09 '20 at 10:49
  • Please tell me what should I do? –  Jun 10 '20 at 03:34
  • I already told you: make sure your proxy is not blocking these requests or it could be that the repo is down temporarily for maintenance :) – m0skit0 Jun 10 '20 at 07:18

4 Answers4

2

you can try to change the URL from http to https

maven {
    url 'https://developer.huawei.com/repo/'
} // HUAWEI Maven repository
flybird
  • 51
  • 2
1

Check if your project level build.gradle looks like this

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/' }
    }
}
danms07
  • 141
  • 4
0

Please make sure your network has no problems.

skylinnn
  • 629
  • 1
  • 4
  • 6
0

You can check if your AS can connect to huawei maven repo using proxy or not. Then you can know if it is the proxy that blocked you from linking to Huawei maven repo.You can disable the proxy and delete the gradle.properties file under .gradle directory. Then Sync again. Android Studio Check connection screenshots

houweilong
  • 46
  • 2