Home > Software design >  Could not resolve com.huawei.agconnect:agcp:1.6.0.300
Could not resolve com.huawei.agconnect:agcp:1.6.0.300

Time:12-01

need help how to fix problem of 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/'}    
    }

CodePudding user response:

Received status code 502 from server: Bad Gateway

This may be because the gradle is in offline mode or the current network is limited. Therefore, you are advised to check the gradle configuration and network settings.

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

For details about how to configure the build.gradle file, kindly refer to this.

CodePudding user response:

Taken from here

Could not find com.huawei.agconnect:agcp:1.0.0.300

"Looks like you are missed to add application gradle configurations.

Try after adding these lines on your gradle file

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

"

Or one of the other options there..

  • Related