-1

I am connected to my organization network. I have enabled the proxy. Android studio is successfully able to download plugins and update using the proxy. But the build is never successful. During Gradle sync, the 'Run Build' is always failing. I can see in the status bar that none of the files are downloading. The error received is -

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:29

There are several similar errors such as cannot resolve junit, layout, constraints. Etc etc.

My Android Studio version is 3.2.1. I am on my organization network which doesn't allow any direct download. I am already using proxy but still, the same error exists.

Please help.

Niraj
  • 903
  • 8
  • 23
  • Does this answer your question? [Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0](https://stackoverflow.com/questions/46999594/unable-to-resolve-dependency-for-appdebug-compileclasspath-could-not-resolv) – Masoom Badi Jan 16 '20 at 09:47
  • There is a question with the same issue, maybe this will help https://stackoverflow.com/questions/51218535/unable-to-resolve-dependency-for-appdebug-compileclasspath-could-not-resolv – Maxim M Jan 16 '20 at 09:47

2 Answers2

0

Please ensure you have "google()" in your source repository, so check your build.gradle file and ensure repositories part has at least these entries:

repositories {
    google()
    jcenter()
}

Reason is that Google specific libraries are not published in central Maven repo

FrankMonza
  • 2,024
  • 16
  • 26
  • Yes I already have these in my source repository. I have tried a lot of things available on the internet but nothing helps. It's always failing to sync gradle. – Varun Srivastava Jan 16 '20 at 09:49
0

add google inside repositories and allprojects-->repositories

 repositories {
         google()
         jcenter()


    }
ThavaSelvan
  • 123
  • 6
  • Yes it's within all projects ---> repositories. The major problem is that ALL gradle downloads are failing. Which has to do something with the proxy and settings I am guessing. But at the same time Android studio is able to download the plugins and updates. – Varun Srivastava Jan 16 '20 at 09:54