Search code examples
androidproguardin-app-billingandroid-proguard

proguard - Duplicate zip entry classes.jar


I am unable to build signed apk. I implemented this library into my project: https://github.com/anjlab/android-inapp-billing-v3

after I implemented it, when I try to generate apk this error appears:

    Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Can't write [C:\Users\Admin\StudioProjects\MealPlanner\app\build\intermediates\transforms\proguard\release\jars\3\1f\main.jar] (Can't read [C:\Users\Admin\StudioProjects\MealPlanner\app\build\intermediates\exploded-aar\com.android.billingclient\billing\1.0\jars\classes.jar(;;;;;;**/*.class)] (Duplicate zip entry [classes.jar:com/android/vending/billing/IInAppBillingService$Stub$Proxy.class]))

I don't have any aidl file in my project and I tried outjars and exluding it from build.gradle but still the problem persists.

Any ideas how to solve this?


Solution

  • When i was trying to build an in-app billing app for Google play (based on their TrivialDrive sample) in Android Studio 3.2.1, buildtools version 28.0.3, i also found that generation of the signed release APK was blocked by Java.IO.Exception, transformClassesAndResourcesWithProguardForRelease, duplicate zip entry classes etcetera ...

    First i followed recommendations on the internet to adapt the proguard pro file, then i updated the buildtools version, changed my gradle file many times, nothing helped!

    The strange thing is that there was no problem with the original trivialdrive sample build 2 weeks ago with dependencies including 'com.android.billingclient:billing:1.1'.

    After deleting implementation 'com.android.billingclient:billing:1.1', the build was successful! So i think something was changed for in-app billing dependency requirements??