Error:Unknown host 'dl.google.com' You may need to adjust the proxy settings in Gradle

前端 未结 13 2061
长情又很酷
长情又很酷 2020-12-06 16:50

I am getting this error in android studio 3.0.

Unknown host \'dl.google.com\' You may need to adjust the proxy settings in Gradle

<
13条回答
  •  臣服心动
    2020-12-06 17:13

    This error appears if its have not compatible versions of Android Gradle plugin and Gradle wrapper. This versions works for me:

    project_dir/build.gradle

    buildscript {
    dependencies {
            classpath('com.android.tools.build:gradle:3.5.1')
        }
    }
    

    project_dir/gradle/wrapper/gradle-wrapper.properties

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    
    

提交回复
热议问题