1

this is my build.gradle file:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.14.2'
    }
}
apply plugin: 'com.android.application'

repositories {
    jcenter()
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.example.stopcall.app"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:21.0.3'
    compile 'org.roboguice:roboguice:3.+'
    provided 'org.roboguice:roboblender:3.+'
}

I don't know why but sometimes I get this error while building:

Error:Gradle: A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not resolve org.roboguice:roboguice:3.+.
     Required by:
         StopCall:app:unspecified
      > Failed to list versions for org.roboguice:roboguice.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/org/roboguice/roboguice/maven-metadata.xml.
            > Could not GET 'https://jcenter.bintray.com/org/roboguice/roboguice/maven-metadata.xml'.
               > cache.corp.google.com: nodename nor servname provided, or not known
      > Failed to list versions for org.roboguice:roboguice.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/org/roboguice/roboguice/maven-metadata.xml.
            > Could not GET 'https://jcenter.bintray.com/org/roboguice/roboguice/maven-metadata.xml'.
               > cache.corp.google.com
   > Could not resolve org.roboguice:roboblender:3.+.
     Required by:
         StopCall:app:unspecified
      > Failed to list versions for org.roboguice:roboblender.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/org/roboguice/roboblender/maven-metadata.xml.
            > Could not GET 'https://jcenter.bintray.com/org/roboguice/roboblender/maven-metadata.xml'.
               > cache.corp.google.com
      > Failed to list versions for org.roboguice:roboblender.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/org/roboguice/roboblender/maven-metadata.xml.
            > Could not GET 'https://jcenter.bintray.com/org/roboguice/roboblender/maven-metadata.xml'.
               > cache.corp.google.com



what can it be? as it can happen in a specific hour and few hours later (maybe another network) it might be fixed.

any idea?

Elad Benda2
  • 13,852
  • 29
  • 82
  • 157

1 Answers1

0

Are you behind a proxy? if so check your gradle properties file

Under C:\Users\.gradle\ create a gradle.properties file with the proxy details:

systemProp.http.proxyHost=hostname
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=username
systemProp.http.proxyPassword=xxx

systemProp.https.proxyHost=hostname
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=username
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=localhost
Lachlan Goodhew-Cook
  • 1,101
  • 17
  • 31
  • it's my job laptop so i use VPN proxy when I want to connect to my work network. but the problem occurs when I'm at home working on my private wifi without proxy on. – Elad Benda2 Jan 08 '15 at 08:04
  • I don't want to write my credentials in `.gradle` file. no other way? – Elad Benda2 Jan 08 '15 at 08:05
  • If you're using an NTLM proxy you could try setting up http://cntlm.sourceforge.net/. Or something like this in android studio http://stackoverflow.com/a/18443524/3724365 – Lachlan Goodhew-Cook Jan 08 '15 at 22:41
  • im working in intellij. but why is it even necessary? as the VPN is off now – Elad Benda2 Jan 10 '15 at 08:56
  • It should only be necessary to have a connection to the internet unless you have configured gradle to work without an active connection. – Lachlan Goodhew-Cook Jan 10 '15 at 08:58
  • i don't get it. I surf the net without proxy. why would it be a problem for gradle to connect without any addon? – Elad Benda2 Jan 10 '15 at 09:07
  • It wouldn't be. The first line of the answer is asking if you're using a proxy. you're having trouble with getting an https resourcre which in my experience means proxy issues. Also most browsers are pretty good with using ntlm proxies by default where almost any other software requires configuration. – Lachlan Goodhew-Cook Jan 10 '15 at 09:13
  • so which url, user and password should I put here ?http://www.gradle.org/docs/current/userguide/userguide_single.html#sec%3aaccessing_the_web_via_a_proxy – Elad Benda2 Jan 10 '15 at 09:23