During the development process, while synchronizing the code, this error message suddenly appears:

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'.
Copy the code

This made me, who had been irritable, suddenly want to blast WTF. It is more important to solve the problem!

What is the solution to the problem? What is the solution to the problem, what is the solution to the problem? What is the solution to the problem, what is the solution to the problem? Anyway, I have tried all kinds of successful cases of big men, but I have repelled them one by one. I have tried many methods, but none of them can solve this problem, which makes me, who was already urging me to go online, even worse.

You still have to look for the problem in the error message:

Gradle is in offline mode because it cannot access the server.

Then the offline mode will be started. As shown in the figure, the button is highlighted as “Open”, and then synchronize:

Once the synchronization is complete, you can start typing code happily again.

This is a temporary fix, but when you need to update a third party library, this error message keeps appearing, which is definitely not what we want, so we have to continue to fix it.

This question puzzled me for a few days, and just when I was desperate, I saw the error message as follows:

Could not resolve com.huawei.agconnect:agcp:1.21.301..
         > Could not get resource 'https://dl.bintray.com/umsdk/release/com/huawei/agconnect/agcp/1.2.1.301/agcp-1.2.1.301.pom'.
            > Could not GET 'https://dl.bintray.com/umsdk/release/com/huawei/agconnect/agcp/1.2.1.301/agcp-1.2.1.301.pom'. Received status code 502 from server: Bad Gateway
Copy the code

The error message here refers to that the third-party library pushed by Huawei cannot be obtained. Compare the error message with the configuration information on huawei official website:

A comparison of the error messages shows that the link to obtain resources is too much:

https://dl.bintray.com/umsdk/release
Copy the code

This Huawei push seems to have nothing to do with it, so I tried to change the position and advance the huawei push position, as shown in the picture:

This problem will not occur after the synchronization. The problem should be that huawei pushed the synchronization library file under the influence of UmU, so the synchronization cannot be done. Please note that. Welcome to pay attention to the public account [Dragon Xuan] can get the latest updates oh.