For now, the android
tasks will fail if you try to add the same class twice to the dex file.
If you happen to add some dependency that adds any class already in the rt.jar, that will fail.
Typically, when adding Jersey dependencies, javax.annotation
classes are added from javax.annotation-api-1.2.jar, while some of them are already present in the JDK.
The solution, in case you don't have the source code to remove those duplicated classes, will be excluding some groups from the dependencies.
This works for me, at least running android
task, but without further testing with a real case:
dependencies {
compile 'com.gluonhq:charm:2.2.0'
compile ('org.glassfish.jersey.core:jersey-client:2.22.2') {
exclude group: 'javax.annotation'
exclude group: 'javax.inject'
}
androidRuntime 'com.gluonhq:charm-android:2.2.0'
iosRuntime 'com.gluonhq:charm-ios:2.0.0'
desktopRuntime 'com.gluonhq:charm-desktop:2.0.0'
}