My application is working fine in my simulator, however it is failing to build my APK.
This is the error I get:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/android/vending/billing/IInAppBillingService$Stub$Proxy.
I have everything set up in my Gradle file supposedly correct, so I am not sure why I get this error. Here is my Gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "flarehubpe.xflare.flarehub"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.anjlab.android.iab.v3:library:1.0.+'
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
testCompile 'junit:junit:4.12'
}
It seems that my one library is causing this- when I remove the line compile 'com.anjlab.android.iab.v3:library:1.0.+'
the app builds fine. How can I fix the problem but not have to remove the library?