Android Studio在项目构建时报Could not find lint-gradle-api.jar 错误的解决办法

        网上有很多报下面这个错误:

      这个错误的解决办法,经常都是莫名出现的,这个问题是由于项目build.gradle中没有配置google()所造成的,一般在buildscript和allprojects的配置项中都加上即可,然而有时还是解决不了问题,有些项目本来就已经加了,或者手动添加了依旧不行,其实这个时候可以试一下,将google()都放到jcenter()之前就可以了,而且allprojects中都不一定要加上,保证buildscript 中有就行了。感觉这个还是网络问题造成的。

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'

    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }

    }
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值