Failed to resolve: support-compat

  • 在网上下载了一个android开源app,用Android studio打开后编译时遇到下面的错误
Failed to resolve: support-compat
  • project gradle script
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: "dependencies.gradle"

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
  • 最终发现是classpath中的gradle版本不对,改成和本地其他项目一致的版本就对了
classpath 'com.android.tools.build:gradle:3.2.1'
    原文作者:鹅鹅鹅_
    原文地址: https://www.jianshu.com/p/e343fe5ee413?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞