我有一个名为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'
}
,但问题仍然存在。我的想法已经用完了。有人可以帮忙吗?
答案 0 :(得分:1)