Ildar Ishalin
Ildar Ishalin

Reputation: 71

Android Studio: Gradle fails to resolve dependencies

I'm trying to build imported project.

The process "Gradle: Resolve dependencies ':app:_debugCompile'" just keeps on running

So I searched the internet and found out that I need to run gradlew build --stacktrace --debug in terminal

Then I saw, that at some point Android Studio tries to do this:

Connecting to 10.153.20.12:8080

then connection fails and build fails too:

 FAILURE: Build failed with an exception.
 * What went wrong:
 A problem occurred configuring root project 'MyProject'.
 > Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:1.2.3.
 Required by:           
     :MyProject:unspecified
  > Could not resolve com.android.tools.build:gradle:1.2.3.
     > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.2.3/gradle-1.2.3.pom'.
        > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.2.3/gradle-1.2.3.pom'.
           > Connection to http://10.153.20.12:8080 refused

P.S.: other projects build without problems

P.P.S.: same stuff happens on different computers

Here's my app:build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "ru.myrunner.myrunner"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.pkmmte.view:circularimageview:1.1'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:cardview-v7:22.2.1'
    compile 'com.google.android.gms:play-services:7.8.0'
    compile 'com.android.support:recyclerview-v7:22.2.1'
}

Edit: apparently, the problem is with

compile 'com.pkmmte.view:circularimageview:1.1'

Upvotes: 3

Views: 7657

Answers (1)

Ildar Ishalin
Ildar Ishalin

Reputation: 71

The answer was lying inside gradle.properties file, where previous developer put proxy settings. That's why my AS couldn't connect to 10.153.20.12:8080

I simply commented everything in that file and it worked.

Problem with circularimageview was because it was a new library so my AS had to download it from the internet, failing to do so because proxy server was unavailable.

Upvotes: 4

Related Questions