Android Studio Rebuild失败:Could not find com.android.tools.lint:lint-gradle:26.1.1.

解决方案:

1 在项目根目录中buildscript{}添加 google()仓库,

2 在allprojects { repositories {}  }内添加google()

注意google()要在加在jcenter()之前,否则没有效果,依旧报错

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()

//        maven {
//            url "https://oss.sonatype.org/content/repositories/snapshots"
//        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
//        classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
发布了53 篇原创文章 · 获赞 20 · 访问量 17万+

猜你喜欢

转载自blog.csdn.net/wqbs369/article/details/83508219