其他分享
首页 > 其他分享> > 解决支持库版本兼容问题:all com.android.support libraries must use the exact same version specification

解决支持库版本兼容问题:all com.android.support libraries must use the exact same version specification

作者:互联网

相信大家都会遇到如下图所示的问题:

å±å¹å¿«ç§ 2017-09-10 12.58.38.png

如果引用的第三方库的支持库版本低于(或者不一致)app build.gradle中的支持库版本,可能会出现如下问题:

all com.android.support libraries must use the exact same version specification(mixing versions can lead to runtime crashes)

解决办法就是:在app build.gradle中添加:

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'
            }
        }
    }
}

 

标签:requested,use,兼容问题,com,support,details,android,exact,app
来源: https://blog.51cto.com/u_12682483/2823747