How to resolve 407 Proxy issue?

Could not GET ‘https://jcenter.bintray.com/com/android/tools/build/gradle/1.2.3/gradle-1.2.3.pom’. Received status code 407 from server: Proxy Authentication Required

i have updated the properties files with proxyname,port , username and password used HTTPS as well .

Can we download the .pom file offline ?

below are the proxy setting i have used.

systemProp.https.proxyHost=
systemProp.https.proxyPort=
systemProp.http.proxyUser=
systemProp.http.proxyPassword=

Looks like you’ve configured the http proxy settings but not the https settings

You can try the latest Buildship snapshot which has a support for proxy settings. If you set the http/https proxy settings in the Eclipse preferences UI, Buildship and Gradle will automatically make use of it.

Update: starting from version 1.0.3, Buildship support working behind the firewall.

@donat: This has nothing to do with Buildship. This is a pure gradle. And I confirm, it DOES NOT work. The problem in Gradle is still there.

@vamsijakkula: See https://docs.gradle.org/current/userguide/build_environment.html#sub:ntlm_authentication.
For NTLM authentication use not only the name, but also domain name. Slash is important, namely, normal slash, “/”.
For me it worked only after I have provided the whole name with domain:
systemProp.http.proxyUser=domain/user

You’re saying that those are all the “proxy” system properties you’ve set? You’re setting “proxyHost” and “proxyPort”, but only for “https”, and you’re setting “proxyUser” and “proxyPassword”, but only for “http”. Seems pretty clear why you’re getting a 407. You’ve set the host:port, but not the user/password. The URL is using “http”, so it tries to use the settings for “http”, but you’ve only set the host and port.

I have entered following in my gradle.properties file

systemProp.http.proxyPort=80
systemProp.http.proxyUser=ra****
systemProp.https.auth.ntlm.domain=******
systemProp.http.proxyPassword=******

systemProp.https.proxyPassword=******
systemProp.https.proxyHost=******
systemProp.http.auth.ntlm.domain=*****
systemProp.http.proxyHost=******
systemProp.https.proxyPort=80
systemProp.https.proxyUser=ra***

And when I run react-native run-android , I get " Received status code 407 from server: Proxy Authentication required".
You can Have a look at this https://stackoverflow.com/questions/46771053/cannot-build-for-android-using-react-native/46772026?noredirect=1#comment80511637_46772026 for more understanding of the question.
Thanks in Advance.

I encountered a similar issue in the Eclipse environment. Although our corporate proxy does not require authentication Gradle kept complaining about 407 error code.

After adding bogus proxyUser and proxyPassword properties to the gradle.properties file the issue went away.

Below are my complete set of properties.

systemProp.http.proxyHost=
systemProp.http.proxyPort=
systemProp.http.proxyUser=blah
systemProp.http.proxyPassword=blah
systemProp.https.proxyHost=
systemProp.https.proxyPort=
systemProp.https.proxyUser=blah
systemProp.https.proxyPassword=blah

Hope this helps someone since I wasted several hours trying to resolve this issue.

I set all properties in the file build.gradle but when I try to syn my project this message is showed :slight_smile: > Could not GET ‘https://jcenter.bintray.com/com/sun/istack/istack-commons-runtime/2.21/istack-commons-runtime-2.21.jar’. Received status code 407 from server: Proxy Authentication Required

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 0s

build.gradle code:

Preformatted text apply plugin: ‘com.android.application’

android {
compileSdkVersion 28
defaultConfig {

    applicationId "tn.tunisapp.rawabimobile"
    minSdkVersion 15
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    systemProp.http.proxyHost=172.16.0.1
    systemProp.http.proxyPort=3128
    systemProp.http.proxyUser=08596585
    systemProp.http.proxyPassword=Ym47Ar
    systemProp.http.auth.ntlm.domain=172.16.0.1

    systemProp.https.proxyHost=172.16.0.1
    systemProp.https.proxyPort=3128
    systemProp.https.proxyUser=08596585
    systemProp.https.proxyPassword=Ym47Ar
    systemProp.https.auth.ntlm.domain=172.16.0.1

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies {
implementation fileTree(dir: ‘libs’, include: [’*.jar’])
implementation ‘com.android.support:appcompat-v7:28.0.0-rc02’
implementation ‘com.android.support.constraint:constraint-layout:1.1.2’
testImplementation ‘junit:junit:4.12’
androidTestImplementation ‘com.android.support.test:runner:1.0.2’
androidTestImplementation ‘com.android.support.test.espresso:espresso-core:3.0.2’
}

Please use gradle.properties next to project’s build.gradle file to specify these settings:
systemProp.https.proxyHost=<proxyHost/DNS resolvable name>
systemProp.https.proxyPort=<port>
systemProp.https.proxyUser=<proxy-user>
systemProp.https.proxyPassword=<proxy-password>
systemProp.https.nonProxyHosts=localhost,127.0.0.1,<intranet domains>

systemProp.http.proxyHost=<proxyHost/DNS resolvable name>
systemProp.http.proxyPort=<port>
systemProp.http.proxyUser=<proxy-user>
systemProp.http.proxyPassword=<proxy-password>
systemProp.http.nonProxyHosts=localhost,127.0.0.1,<intranet domains>

Also please check in your <userhome>/.gradle/gradle.properties (Looks like Android Studio directly copies the IDEs proxy settings there without putting a password, instead of making it project local)