Reputation: 181
Getting error
Cause: dl.google.com:443 failed to respond
Below is the build.gradle
file code
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}}allprojects {
repositories {
google()
jcenter()
}}task clean(type: Delete) {
delete rootProject.buildDir}
and
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support.constraint:constraint-layout:1.1.0' 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' }
Upvotes: 15
Views: 16230
Reputation: 339
edit [user]/.gradle/gradle.properties file ( e.g.
/home/jim/.gradle/gradle.properties
or
C:\users\jim\.gradle\gradle.properties
) , config proxy, like this
# https proxy settings.
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=1080
Upvotes: 7
Reputation: 9425
I am an android developer from China, I met the same problem as you. This problem is mostly because I am behind a proxy. So there are two steps that may help you.
File->Settings->Appearance&Behavior -> System Settings -> HTTP Proxy
Then select No proxy option
Locate gradle.properties
file in .gradle
directory (this directory is generally in The User directory) and edit it. Delete every line about HTTP Proxy. Mine is like this
systemProp.https.proxyPort=1080
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=1080
Upvotes: 5
Reputation: 857
I have to delete .AndroidStudio3.x, redo the proxy settings then problems gone.
Upvotes: 0
Reputation: 13
if you are using Psiphon go to setting-->Http proxy and enter the Http proxy number of Psiphon-->Log-->Http proxy is running on localhost ....(number) , and then enter port number sth like 80 , and let android studio download thigs that wants.
Upvotes: 0
Reputation: 75
Please try
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.1.0' }
in your gradle. hope it will help you.
Upvotes: 1