Android dependency 'com.android.support:recyclerview-v7' has different version for the compile (28.0

开发中出现:
Android dependency ‘com.android.support:recyclerview-v7’ has different version for the compile (28.0.0-alpha3) and runtime (28.0.0) classpath. You should manually set the same version via DependencyResolution

主要是依赖包中版本不对;解决方法:

allprojects {
    repositories {
        google()
        jcenter()
    }
    //加入这句
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "28.0.0"
            }
        }
    }
}
发布了187 篇原创文章 · 获赞 65 · 访问量 26万+

猜你喜欢

转载自blog.csdn.net/mhhyoucom/article/details/84391592