AS报错“Could not find com.android.tools.build:gradle:4.1.2.”

更改build.gradle文件,换用阿里镜像

解决报错:Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository ‘maven(http://maven.aliyun.com/nexus/content/groups/public/)’ to redirect to a secure protocol (like HTTPS) or allow insecure protocols.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
jcenter()
//allowInsecureProtocol = true
maven { url "https://maven.aliyun.com/nexus/content/groups/public/" }
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
}
}

allprojects {
repositories {
google()
jcenter()
//allowInsecureProtocol = true
maven { url "https://maven.aliyun.com/nexus/content/groups/public/" }
}
}

AS报错“Could not find com.android.tools.build:gradle:4.1.2.”
https://blog.zhuanjie.ltd/2021/10/14/as-wrong-could-not-find-com-android-tools-buildgradle4-1-2/
作者
转接
发布于
2021年10月14日
许可协议