from : http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2017/0910/8491.html


如果引用的第三方库的支持库版本低于(或者不一致)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 '26.0.1'            }        }    }}


其中,25.3.1就是你要使用的支持库版本号,你可以根据需要改成其它的。







更多相关文章

  1. Android(安卓)安装apk时,报错 Failure [INSTALL_FAILED_TEST_ONLY
  2. 个人Code整理
  3. cocos2dx 安卓电量,网络信号获取(android版本),网狐可以直接复制
  4. 在Android(安卓)8.0之后版本上添加Hidl Service
  5. AndroidStudio4.0 3.0等高版本利用gradle打jar包笔记
  6. MacPro 10.13.6 编译 android-8.1.0_r53
  7. Android关于buildToolVersion与CompileSdkVersion的区别和关系
  8. [Android]如何在Android(安卓)studio中增加一个selector资源(用于
  9. android使用groovy环境配置及所遇问题

随机推荐

  1. android:launchMode="singleTask" 与 onN
  2. Android开机性能分析工具 Bootchart
  3. Android(安卓)筆記-Linux Kernel SMP (Sy
  4. Vue JS 与Android(安卓)webview的交互
  5. Service与Android系统实现(1)-- 应用程序里
  6. Android(安卓)内存泄漏
  7. Android(安卓)RadioGroup中横向、竖向布
  8. Android之数据储存001
  9. [译]依赖反转在Android中的实践
  10. android 单选按钮组的使用