依赖CardView 的时候 Studio报错

来源:互联网 发布:软件安全性设计 编辑:程序博客网 时间:2024/06/07 06:57

此时因为系统用的是V7包

 compile 'com.android.support:appcompat-v7:25.3.1'

而Card 也是V7下面的  26.0.0

版本不匹配导致报错

解决办法:

compile 'com.android.support:cardview-v7:25.3.1-alpha1'


    configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def requested = details.requested
            if (requested.group == 'com.android.support') {
                if (!requested.name.startsWith("multidex")) {
                    details.useVersion '25.3.1'
                }
            }
        }
    }

阅读全文
0 0
原创粉丝点击