Failed to resolve com.android.support:appcompat-v7:26.1.0. => configure HTTP proxy

I downloaded Android Studio 3.0, and I started following on creating my first tutorial for apps . But Gradle threw errors like:

Failed to resolve com.android.support:appcompat-v7:26.1.0.

I searched on SO for similar issues like this and which , but none of them help me.


In the end, I realized that I am using a proxy for Android Studio:

enter image description here

To fix this error, I have to implement a proxy for Gradle by adding these lines to the file gradle.properties:

systemProp.http.proxyHost=127.0.0.1
systemProp.http.nonProxyHosts=localhost, 127.0.0.1
org.gradle.jvmargs=-Xmx1536m
systemProp.http.proxyPort=8118

systemProp.https.proxyHost=127.0.0.1
systemProp.https.nonProxyHosts=localhost, 127.0.0.1
systemProp.https.proxyPort=8118

gradle.properties . , - HTTP HTTPS Gradle

+4
1

. stackoverflow, . - https, gradle.properties. , .

Android- 3, build.gradle :

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

jcenter() https , , ( ), https, gradle.properties, , , . , gradle , . . , jcenter(), Android Studio.

- https gradle.properties :

systemProp.https.proxyHost=<proxy server address>
systemProp.https.nonProxyHosts=localhost, 127.0.0.1
systemProp.https.proxyPort=<port number>
+6

Source: https://habr.com/ru/post/1688764/


All Articles