Android Studio执行sync_with_gradle未找到可信证书sync gradle failed解决经验

build.gradle里写成这样就可以,有时候不行或许是阿里的服务器不行,多sync几次然后重启软件(或者解注释google()然后多sync几次再重启)就神奇的好了。

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        //google()
        //mavenCentral()
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'https://maven.aliyun.com/repository/mavenCentral' }
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.4"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

}

task clean(type: Delete) {
    delete rootProject.buildDir
}

 

posted @ 2022-05-09 10:57  小汀  阅读(97)  评论(0编辑  收藏  举报