我正在开发一个使用以下依赖项的
Android项目:
<dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> <version>2.17</version> </dependency>
但是,此依赖关系具有模块javax / inject的2个定义,如gradle依赖关系树中所示:
+--- org.glassfish.jersey.core:jersey-client:2.17 | +--- org.glassfish.jersey.core:jersey-common:2.17 | | +--- org.glassfish.hk2:hk2-api:2.4.0-b10 | | | +--- javax.inject:javax.inject:1 | | +--- org.glassfish.hk2.external:javax.inject:2.4.0-b10
在尝试运行Android应用程序时,我收到错误:
com.android.dex.DexException: Multiple dex files define L/javax/inject/Inject