Unable to resolve dependency for ‘:app@debug/compileClasspath‘: Could not download ...

Unable to resolve dependency for ‘:app@debug/compileClasspath’: Could not download

Students, do you feel familiar when you see this line of code?

insert image description here

This is the problem I encountered today. I pulled down the code and wanted to run it. It was because my colleague added a new dependency, but I still couldn’t download it. Then I clicked the icon to reload the dependency and wanted to download it. But he didn't download it after downloading for a long time, saying that there was a problem with the proxy, the connection failed or something. I have tried a lot of methods before, such as modifying the mirror image, but none of them succeeded, but today this problem was solved at once

First
insert image description here
find the .gradle file under your C disk, then open the gradle.properties file, and then comment out all the things in it,
insert image description here
like this, and then reopen the project

I am using the 3.6.3 version of Android Studio. When I reopen it, there will be a prompt box, which is to set the proxy, and then click Yes without setting anything. Then the project can be restored to normal

Guess you like

Origin blog.csdn.net/m0_46366678/article/details/120221085