android build gradle错误(android 3.1.3)?连接超时:连接

时间:2018-06-28 23:55:57

标签: android-studio gradle compiler-errors build.gradle jcenter

我的gradle版本无法获取

'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom'。166内部通话

'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom'

我的构建gradle

 // Top-level build file where you can add configuration options common to 
    all sub-projects/modules.

buildscript {

   repositories {
    google()
    jcenter()
  }
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'


    // 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
 }

渐变包装的适当性

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

1 个答案:

答案 0 :(得分:0)

您的PC上是否装有杀毒软件?尝试关闭它。 我遇到了同样的问题:

  

无法获取资源   https://jcenter.bintray.com/com/android/databinding/compiler/3.1.3/compiler-3.1.3.pom

我的PC上有Kasperskiy Internet Secirity。禁用它后,我能够进行项目投影,然后转到“文件”->“使缓存无效”并重新启动。然后项目成功构建。 然后我重新启用KIS,可以毫无问题地构建项目。