Could not find com.android.tools.lint:lint-gradle:26.1.1

打包的时候突然遇到这个情况Could not find com.android.tools.lint:lint-gradle:26.1.1_第1张图片

主要的原因是谷歌的第三方库无法访问。在网上查了很多资料,说是用代理之类的。在这里给大家提供一个不需要任何代理的方式:在最外出的bulid.grade问下进行如下配置。直接用阿里提供的镜像,不再链接谷歌的系统

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
//        google()
//        jcenter()
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
//    defaultConfig {
//        ndk {
//
//            //APP的build.gradle设置支持的SO库架构
//
//            abiFilters 'armeabi', 'armeabi-v7a', 'x86'
//        }
//
//    }

}
allprojects {
    repositories {

//        google()
//        jcenter()
//        maven { url 'https://maven.google.com' }
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
    }
}

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

其次在Moulde的bulid.grade中配置

android{

........

lintOptions {
    checkReleaseBuilds false
    // Or, if you prefer, you can continue to check for errors in release builds,
    // but continue the build even when errors are found:
    abortOnError false
}

} clean下项目即可

你可能感兴趣的:(android)