解决支持库版本兼容问题:all com.android.support libraries must use the exact same version specification
2018-03-16 09:35
821 查看
如果引用的第三方库的支持库版本低于(或者不一致)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'
}
}
}
}
其中,25.3.1就是你要使用的支持库版本号,你可以根据需要改成其它的。
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'
}
}
}
}
其中,25.3.1就是你要使用的支持库版本号,你可以根据需要改成其它的。
相关文章推荐
- 解决支持库版本兼容问题:all com.android.support libraries must use the exact same version specification
- All com.android.support libraries must use the exact same version specification 的解决方法
- All com.android.support libraries must use the exact same version specification解决
- Exception:All com.android.support libraries must use the exact same version specification
- all com.android.support libraries must use the exact same version specification
- All com.android.support libraries must use the exact same version specification
- Android Studio2.3 All com.android.support libraries must use the exact same version specification..
- Android Studio2.3 All com.android.support libraries must use the exact same version specification...
- java.lang.UnsatisfiedLinkError与all com.android.support libraries must use the exact same...问题的处理办法
- android4.1 JELLY_BEAN:All WebView methods must be called on the same thread[问题已解决]
- Cause by:All WebView methods must be called on the same thread[问题已解决]
- android4.1 JELLY_BEAN:All WebView methods must be called on the same thread[问题已解决]
- [android引用他人包出现的错误]All versions of the libraries must be the same at this time.以及It is indirectly re
- All the support libraries have to be the same version. Try changing either appcompat-v7 and support-
- 使用android OpenGL时出现的java.lang.IllegalArgumentException: Must use a native order direct Buffer错误问题解决
- The server does not support version 3.0 of the J2EE Web module specification Eclipse的web项不支持tomcat6
- com/android/dx/command/dexer/Main:Unsupported major.minor version 52.0 问题的解决方法总结
- AndroidStudio自定义属性xmlns无法识别问题解决in Gradle projects,always use http://schemas.android.com/apk/res-auto
- 【Android】图片剪裁类库,解决com.android.camera.action.CROP在4.4版本以上遇到的intent类型问题
- AndroidStudio自定义属性xmlns无法识别问题解决in Gradle projects,always use http://schemas.android.com/apk/res-auto