androidandroid-studioandroid-gradle-pluginhttp-status-code-407

gradle 3.2 failed to sync in android studio 3.2


i just downloaded the android studio 3.2 and it cannot sync my new project gradle. i m using a proxy and i entered the proxy details in setting too. but i get this error:

Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.0/gradle-3.2.0.pom'. Received status code 407 from server: Proxy Authentication Required
Enable Gradle 'offline mode' and sync project   

i downloaded the file with google chrome. when i use the 'offline mode' in gradle , i get this error:

No cached version of com.android.tools.build:gradle:3.2.0 available for offline mode.
Disable Gradle 'offline mode' and sync project

what should i do?


Solution

  • i added this proxy details to the gradle.properties and it worked. if you wanna find gradle.properties go to C:\Users\youruser.gradle and you find it.

        systemProp.http.proxyPort=your port 
    systemProp.http.proxyUser=vpn username
    systemProp.http.proxyPassword=vpnpass
    systemProp.https.proxyPassword=vpn pass
    systemProp.https.proxyHost=vpn ip
    systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
    systemProp.http.proxyHost=vpn ip
    systemProp.https.proxyPort=your port
    systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
    systemProp.https.proxyUser=vpn username
    

    sometimes if you use your username and password in android studio setting, it doesn't work.

    /////////// *****first check if the android studio can use your proxy without giving it the information.you can check the (no proxy) box in setting>appearance and behavior>system setting>http proxy, and try to rebuild the project