user13545752
user13545752

Reputation:

Android Studio cannot download com.huawei.hms:push:4.0.2.300

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

Upvotes: 3

Views: 3308

Answers (4)

danms07
danms07

Reputation: 141

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/' }
    }
}

Upvotes: 1

skylinnn
skylinnn

Reputation: 649

Please make sure your network has no problems.

Upvotes: 0

houweilong
houweilong

Reputation: 66

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

Upvotes: 0

flybird
flybird

Reputation: 51

you can try to change the URL from http to https

maven {
    url 'https://developer.huawei.com/repo/'
} // HUAWEI Maven repository

Upvotes: 2

Related Questions