I am working on an Android project that uses the following dependency:
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.17</version>
</dependency>
However this dependency has 2 definitions of the module javax/inject as shown here in the gradle dependency tree:
+--- 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
When attempting to run the Android application I get the error:
com.android.dex.DexException: Multiple dex files define L/javax/inject/Inject
I have tried excluding either of these modules but that does not work because the dependency relies on both of them to make method calls.
Are there any other solutions to resolve this conflict?