Gradle依赖项冲突解决:

时间:2019-03-04 06:22:17

标签: android gradle dependencies

我有以下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"
        }
    }
}

这是解决依赖冲突的最理想方法吗?

0 个答案:

没有答案