Android Studio报错:Error:Could not find com.android.tools.build:gradle:4.9; peer not authenticated

解决过程:

 

gradle的下载地址:http://services.gradle.org/distributions/

 

尝试1:https://blog.csdn.net/chy555chy/article/details/52789696

尝试2:https://www.jianshu.com/p/e371aa61d462

尝试3:https://blog.csdn.net/csdn_liuwen/article/details/62898129

https://blog.csdn.net/wenqiang0718/article/details/51274585

 

报错:Android studio 导入项目报 Error:Cause: peer not authenticated 异常

解决办法:

https://www.jianshu.com/p/5d482c73fd91

 

报错:transformDexWithInstantRunDependenciesApkForDebug

解决:https://blog.csdn.net/jiyilidenapianhai/article/details/80210455

 

各种问题,最后的最终解决是:

build.gradle要配置成如下内容:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter() {
            url "http://jcenter.bintray.com/"
        }
        maven {
            url 'https://maven.google.com'
        }
        maven { url 'https://jitpack.io' }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter() {
            url "http://jcenter.bintray.com/"
        }
        maven { url 'https://jitpack.io' }
        maven {
            url 'https://maven.google.com'
        }
    }

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

 

且去掉勾选:

 

Android Studio报错:Error:Could not find com.android.tools.build:gradle:4.9; peer not authenticated_第1张图片

你可能感兴趣的:(android)