Could not find support-media-com

2019-02-11  本文已影响17人  gsyQAQ

升级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"
        }
    }
}
上一篇 下一篇

猜你喜欢

热点阅读