美文网首页
Could not find support-media-com

Could not find support-media-com

作者: gsyQAQ | 来源:发表于2019-02-11 15:27 被阅读17次

升级android studio到3.3版本,今天checkout到历史tag上运行android项目,死活报错

  • 之前也有同事遇到过类似的问题

Could not find support-media-compat.aar


最后意外发现是google()仓库位置的问题
报错配置:

allprojects {
    repositories {
        flatDir {
            dirs 'libs'
        }
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url "https://dl.bintray.com/thelasterstar/maven/" }
        maven {
            url "http://maven.aliyun.com/nexus/content/repositories/releases"
        }
        mavenCentral()
        google()
    }
    configurations.all {
        resolutionStrategy {
            force "com.android.support:appcompat-v7:$supportLibVersion"
        }
    }
}

把google()放到第一位即可

allprojects {
    repositories {
        google()
        flatDir {
            dirs 'libs'
        }
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url "https://dl.bintray.com/thelasterstar/maven/" }
        maven {
            url "http://maven.aliyun.com/nexus/content/repositories/releases"
        }
        mavenCentral()
    }
    configurations.all {
        resolutionStrategy {
            force "com.android.support:appcompat-v7:$supportLibVersion"
        }
    }
}

相关文章

网友评论

      本文标题:Could not find support-media-com

      本文链接:https://www.haomeiwen.com/subject/hduqeqtx.html