android - Gradle 依赖冲突解决:
问题描述
我有以下 gradle 冲突。
Conflict with dependency 'net.danlew:android.joda' in project ':app'. Resolved versions for runtime classpath (2.10.1) and compile classpath (2.7.2) differ. This can lead to runtime crashes. To resolve this issue follow advice at https://developer.android.com/studio/build/gradle-tips#configure-project-wide-properties. Alternatively, you can try to fix the problem by adding this snippet to C:\Users\...\Documents\...\..\..\build.gradle:
我用来解决此问题的解决方案如下:
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'net.danlew:android.joda'
&& !details.requested.name.contains('joda') ) {
details.useVersion "2.7.2"
}
}
}
这是解决依赖冲突的最理想方法吗?
解决方案
推荐阅读
- excel - 根据单元格颜色隐藏多个列
- javascript - 如何使用 MUI 制作圆形复选框?
- regex - MS Word 2016 宏正则表达式替换
- java - 如何让我的哈希图按照我想要的顺序打印
- python - PySpark - 在数据框列中创建的列表的类型是字符串而不是整数
- javascript - NodeJS - Jimp - 处理 .png 图像以减轻其重量(质量)
- javascript - jQuery timepicker 的两个实例
- android - Dalvik 真的会给回收释放的内存吗?
- amazon-web-services - 使用 CLI 上传的文件夹没有正确的 ACL(文件正常,只有文件夹有问题)
- javascript - Now.sh 构建中断,原因是:当前未启用对实验性语法“decorators-legacy”的支持