'Gradle getting error - HMS Core-Analytics Kit

Getting below error in gradle file after adding HMS analytics dependency.

Caused by: org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not GET 'https://dl.bintray.com/populov/maven/com/huawei/agconnect/agcp/1.5.2.305/agcp-1.5.2.305.pom'. Received status code 502 from server: Bad Gateway



Solution 1:[1]

Please check your build.gradle/settings.gradle file and move

maven { url'https://developer.huawei.com/repo/ '} to the top in repositories block as shown below:

enter image description here

Solution 2:[2]

Please make sure below line is added in project level build.gradle file under repositories block

{ url'https://developer.huawei.com/repo/'}

Also make sure that this line should be added at the beginning of the repositories block as shown below

sample build.gradle

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 shirley
Solution 2 Balaji