0

I'm working on a small project in a company which has basically nothing to do with mobile development. I have to use a proxy to connect to the internet and this obviously causes some errors in android studio.

I specified my proxy settings in file → settings → system settings → HTTP Proxy accordingly. Then i can connect to any http or https sites.

But when it comes to sync the build i get the following error:

ERROR: Connection timed out: connect

More specifically, i get the following errors:

Could not resolve all artifacts for configuration ':classpath'

Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.android.tools.build:gradle:3.3.2

Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.android.tools.build:gradle:3.3.2

Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.2/gradle-3.3.2.pom

Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.2/gradle-3.3.2.pom

Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.2/gradle-3.3.2.pom

This is my build.gradle file:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

my gradle.properties file only contains comments except for this line:

org.gradle.jvmargs=-Xmx1536m
Zoe
  • 27,060
  • 21
  • 118
  • 148
bautista
  • 765
  • 10
  • 26

1 Answers1

0

basically it is a network issue. my project also fails to build unless I pass the --offline argument to gradle. I think the S3 outage is impacting repos hosting dependencies.

Try ./gradlew tasks --offline

or, to make android studio run in offline mode, follow the instructions, link is here:

https://stackoverflow.com/a/32173577/1043518

Parveen Haade
  • 76
  • 1
  • 13
  • going offline doesn't work for me since i dont have a cached version of the gradle yet. I guess i can add it manually. https://gradle.org/releases/ Will v3.3 work? Cant find 3.3.2. – bautista Apr 10 '19 at 09:46