找了一圈,终于在大佬的博客中找到了解决方法。
附链接: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‘ //这个版本号设置为你想要的版本 } } } }