找到项目目录下的build.gradle文件

buildscript {
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
        maven { url "https://repo.maven.apache.org/maven2" }
    }
    dependencies {
            classpath "com.android.tools.build:gradle:${project.property('android-plugin.version')}"
    }
}
allprojects {

    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
        maven { url "https://repo.maven.apache.org/maven2" }
    }

    tasks.withType(JavaCompile) {
        options.encoding = "UTF-8"
    }

}

因为访问不到url 'https://maven.google.com/'地址,替换成url 'https://maven.aliyun.com/repository/google'

buildscript {
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            url 'https://maven.aliyun.com/repository/google'`
            name 'Google'
        }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
        maven { url "https://repo.maven.apache.org/maven2" }
    }
    dependencies {
            classpath "com.android.tools.build:gradle:${project.property('android-plugin.version')}"
    }
}
allprojects {

    repositories {
        mavenCentral()
        mavenLocal()
        maven {
           url 'https://maven.aliyun.com/repository/google'`
            name 'Google'
        }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
        maven { url "https://repo.maven.apache.org/maven2" }
    }

    tasks.withType(JavaCompile) {
        options.encoding = "UTF-8"
    }

}

重新同步

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐