I am trying to include two different third-party libraries that seem to include different versions of Spongy castle. Both are enabled through compilation commands in my build.gradle, and one of them is enabled as AAR ( @aar ), and the other is enabled as usual.
When I try to compile debug buildType with these two libs (synchronization does not show the problem). I see the following:
Error: execution completed for task ': Application: transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org /spongycastle/LICENSE.class
Look around for how to solve this problem, preserving both libraries (as needed), but could not find a way to do this. Any help from an advanced Android developer or gradle expert would be greatly appreciated.
Thanks!
[build.gradle]
apply plugin: 'com.android.application' repositories { maven { url 'http://mobile-sdk.jumio.com' } } android { compileSdkVersion 23 buildToolsVersion "23.0.2" packagingOptions { pickFirst 'org/spongycastle/x509/CertPathReviewerMessages.properties' pickFirst 'org/spongycastle/x509/CertPathReviewerMessages_de.properties' } defaultConfig { applicationId "com.example.me.license" minSdkVersion 16 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.3.0' compile "com.jumio.android:jumio-mobile-sdk: 1.9.0@aar " compile 'com.worldpay:cse-android-sdk:1.0.2' }
source share