1

I'm trying to run a "first app" application in android studio 3.3. My connection is via proxy. When I try run the "first app", android studio show me the next error:

ERROR: Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom'. Received status code 407 from server: authenticationrequired

Enable Gradle 'offline mode' and sync project

I have setup my proxy in: "File/Settings -> HTTP Proxy" and tried "Check connection" button. This link "https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom" is working fine.

I also uncheck box "Offline work" in "Settings/Build, Execution.../Gradle" and sync project again but it still show the same issue.

I only set up proxy at "File/Settings -> HTTP Proxy", is it enough? Any more places?

In "build.gradle" file has this content:

buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
        mavenCentral()
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

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

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

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

How can I fix that error? Thanks.

  • Possible duplicate of [Android Studio : 407 Proxy Authentication Required](https://stackoverflow.com/questions/53456614/android-studio-407-proxy-authentication-required) – Zoe Jan 18 '19 at 12:16
  • Hi, it is defferent. I tried but it was not successful. Thank for yor answer. – tuấn anh nguyễn Jan 19 '19 at 01:45
  • There is a lot of heck to this question. I can give you the steps which I followed. First, go to settings and set it to No proxy. Invalidate and restart the Android studio. Now, go to the gradle folder in your system and check gradle.properties file if there are some entries as system.prop.http ... if they are not there. Add them manually and try to sync and rebuild the project. You can get those lines from Gradle website where you manually set the HTTP proxy. The problem are many you IP changes dynamically or Android studio is using some caches in the back to set your proxy. – Ishtdeep Hora Jan 19 '19 at 06:07
  • Hi Hora, thank for your answer. – tuấn anh nguyễn Jan 22 '19 at 06:25
  • There is a problem in my proxy. I used my company's proxy and I can not access the link "https://github.com/JetBrains/kotlin.git". I think this leads to error. – tuấn anh nguyễn Jan 22 '19 at 06:34

0 Answers0