0

I need to include two aar libraries in my project (say hello.aar and world.aar). Both of then contains a jar file but of different version (say foo.jar:v1.0 and foo.jar:v2.0)

When I created a debug build, it worked fine.
When I created a release build, I got this error. Duplicate zip entry [foo.1.1.jar:com/foo/BuildConfig.class]
I noticed that error goes away when I remove minifyEnabled true from gradle.

I added -keep class com.foo.** { *; } and still got the same error. I don't want to remove minification from release build. How do I fix it ?

Note: I can't exclude foo.jar from any of the aar file because it will break the aar file.

Rahul Prasad
  • 8,074
  • 8
  • 43
  • 49
  • why? this is not the way dependency works. – Rahul Jan 09 '19 at 07:22
  • https://stackoverflow.com/a/6108133/5901903 chk this https://stackoverflow.com/a/34729002/5901903 – MadLeo Jan 09 '19 at 07:24
  • @RahulKumar this is a special case otherwise I would not have asked it. There are breaking API changes in `foo.v1.0` and `foo.v.2.0`. and I need hello.aar as well as world.aar library for my application to work. – Rahul Prasad Jan 09 '19 at 10:41

0 Answers0