跑项目抛出如下异常
Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.1
原因是jcenter google库无法访问到导致的问题
解决办法:修改build.gradle,注释掉jcenter(),google()。使用阿里的镜像
buildscript {
repositories {
// jcenter()
// google()
//使用下面3个阿里镜像
maven{url 'https://maven.aliyun.com/repository/google'}
maven{url 'https://maven.aliyun.com/repository/jcenter'}
maven{url 'https://maven.aliyun.com/nexus/content/groups/public'}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
allprojects {
repositories {
// jcenter()
mavenCentral()
//BaseRecyclerViewAdapterHelper
maven { url "https://jitpack.io" }
// google()
//使用下面3个阿里镜像
maven{url 'https://maven.aliyun.com/repository/google'}
maven{url 'https://maven.aliyun.com/repository/jcenter'}
maven{url 'https://maven.aliyun.com/nexus/content/groups/public'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
参考:
传送门