org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom'
在AS碰到该问题:
很常见,碰到好多次了,今天记录一下,不能使用google,使用阿里云镜像就可以,修改三个:
1、 build.gradle文件(直接复制过去可以)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url'http://maven.aliyun.com/nexus/content/groups/public/'}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
//根据你的gradle版本来的
}
}
allprojects {
repositories {
jcenter()
maven { url"http://maven.aliyun.com/nexus/content/groups/public/"}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
2、使用Maven库
3、关闭代理
正常编译。