我有一个名为 A 的 android 模块。我将依赖项添加到另一个模块 B,如下所示:implementation project(':B')
. 虽然模块 A 构建没有问题,但当我尝试构建(并运行)集成测试时,我得到
Duplicate class org.xmlpull.v1.XmlPullParser found in modules kxml2-2.3.0.jar (net.sf.kxml:kxml2:2.3.0) and xpp3-1.1.3.3.jar (xpp3:xpp3:1.1.3.3)
Duplicate class org.xmlpull.v1.XmlPullParserException found in modules kxml2-2.3.0.jar (net.sf.kxml:kxml2:2.3.0) and xpp3-1.1.3.3.jar (xpp3:xpp3:1.1.3.3)
Duplicate class org.xmlpull.v1.XmlPullParserFactory found in modules kxml2-2.3.0.jar (net.sf.kxml:kxml2:2.3.0) and xpp3-1.1.3.3.jar (xpp3:xpp3:1.1.3.3)
Duplicate class org.xmlpull.v1.XmlSerializer found in modules kxml2-2.3.0.jar (net.sf.kxml:kxml2:2.3.0) and xpp3-1.1.3.3.jar (xpp3:xpp3:1.1.3.3)
我试图org.xmlpull.kxml
通过将导入语句更改为来排除
implementation (project(':B')) {
exclude group: 'org.xmlpull.v1'
}
但问题仍然存在。我已经没有想法了。任何人都可以帮忙吗?