Hi all gradle experts:
I've go another problem when doing gradle build with proguard.
Below is my project structure:
|---src/
|---libs
|---android-support-v4.jar
|---hello.jar
|---build.gradle
|---settings.gradle
|---library1(using android-libaray plugin)
|---build.gradle
|---libs
|---android-support-v4.jar
|---hello.jar
This all works fine without proguard, however, It will got the exception with proguard function.
The error message is looks like
* What went wrong:
Execution failed for task ':proguardRelease'.
>
java.io.IOException: Can't write
[/home/eason/xxxx/build/
classes-proguard/release/classes.jar]
(Can't read
[/home/eason/xxx/build/exploded-bundles/xxx.aar/libs/android-support-v4.jar(;;;;!META-INF/MANIFEST.MF)]
(Duplicate zip entry [android/support/v4/b/f.class ==
android-support-v4.jar:android/support/v4/util/MapCollections.class]))
BUILD FAILED
From one discussed topic here, I found I need to
1.remove android-support-v4.jar from libs folder
2.add dependency with "compile 'com.android.support:support-v4:13.0.0'" in build.gradle.
But my question is:
1.how can I do for hello.jar here becuase it will also be reference by outer app and library1?
2.Is there any flag can be set in build.gradle to prevent this situation?
Thanks a lot for all your help.