I downloaded Android Studio 3.0 and I started following along building my first app tutorial. But Gradle threw errors like:
Could not resolve com.android.support:appcompat-v7:26.1.0.
I searched on SO for similar problems like this and that, but none of them helps me.
Eventually I figured out that I'm using a proxy for Android Studio:
To resolve the error, I have to implement the proxy for Gradle too, by adding these lines to gradle.properties
file:
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
After adding the above statements to gradle.properties
, the error got resolved. Note that both HTTP
and HTTPS
proxies need to be added to Gradle properties