在模块类中找到重复的类

时间:2020-03-05 09:49:14

标签: java android

我添加了一个dialogflow库,并且出现此错误。

此错误在其他项目中相同。

Duplicate class org.threeten.bp.Clock found in modules threetenbp-1.3.7-no-tzdb-no-tzdb.jar 
(org.threeten:threetenbp:1.3.7) and threetenbp-1.3.7.jar (org.threeten:threetenbp:1.3.7)
Duplicate class org.threeten.bp.Clock$FixedClock found in modules threetenbp-1.3.7-no-tzdb-no- 
tzdb.jar (org.threeten:threetenbp:1.3.7) and threetenbp-1.3.7.jar (org.threeten:threetenbp:1.3.7)
Duplicate class org.threeten.bp.Clock$OffsetClock found in modules threetenbp-1.3.7-no-tzdb-no- 
tzdb.jar (org.threeten:threetenbp:1.3.7) and threetenbp-1.3.7.jar (org.threeten:threetenbp:1.3.7)

我尝试过的代码

    configurations {
    all*.exclude module: 'org.threeten.bp' //
}

    implementation ('com.google.cloud:google-cloud-dialogflow:0.117.0-alpha') {
    exclude group :"org.threeten.bp"
}

android.enableJetifier=true
android.useAndroidX=true

删除

//com.jakeewharton.threvenabp:threvenabp:1.1.1'

并使缓存无效

build.gradle file on Github

1 个答案:

答案 0 :(得分:2)

在排除配置中,您没有定义group名称,并且module名称被错误地传递。

configurations {
    all{
       exclude group :"org.threeten", module: "threetenbp"
    }
}

我的完整答案是here