Could not find com.android.tools.lint:lint-gradle:26.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下项目即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值