Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dl.google.com:443 failed to respond

Tags:

android

gradle

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' }
like image 881
Hasid Mansoori Avatar asked Jun 04 '18 05:06

Hasid Mansoori


3 Answers

edit [user]/.gradle/gradle.properties file, config proxy, like this

#systemProp.https.proxyHost=127.0.0.1
#systemProp.https.proxyPort=1080
like image 199
mengxn Avatar answered Sep 25 '22 09:09

mengxn


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.

like image 45
chitra Sathwara Avatar answered Sep 24 '22 09:09

chitra Sathwara


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.

  1. File->Settings->Appearance&Behavior -> System Settings -> HTTP Proxy

    Then select No proxy option

  2. 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
    
like image 36
Cyrus Avatar answered Sep 25 '22 09:09

Cyrus