android studio 编译 Android dependency has different version

找了一圈,终于在大佬的博客中找到了解决方法。

附链接:https://blog.csdn.net/u010725171/article/details/81232183

Android dependency has different version for the compile and runtime

在module的外层的build.gradle中添加

subprojects {
        project.configurations.all {
            resolutionStrategy.eachDependency { details ->
                if (details.requested.group == 'com.android.support'
                        && !details.requested.name.contains('multidex') ) {
                    details.useVersion '28.0.0' //这个版本号设置为你想要的版本
                }
            }
        }
    }

posted @ 2019-08-04 20:33  k_kK  阅读(345)  评论(0编辑  收藏  举报