直接在安卓项目的根目录下的build.gradle添加代码如下:
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'androidx.core' &&
!details.requested.name.contains('androidx')) {
details.useVersion "1.5.1"
}
}
}
}
参考:
Android dependency ‘androidx.core:core’ has different version for the compile
Android dependency ‘androidx.lifecycle:lifecycle-runtime’ has different version for the compile
版权声明:本文为yzpbright原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。