Andriod Proguard issue in gradle


Am a Andriod developer I use gradle to build my projects , if I use proguard I get an IOException and it says

  • What went wrong: Execution failed for task ‘:ProjectName:proguardRelease’. > Can’t write [:***\build\inter mediates\classes-proguard\release\classes.jar] (Can’t read [:***\build\intermediates\exploded-aar\android\MSFPush\1.1.6\libs\support -v4-19.1.0.jar(;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [android/suppo rt/v4/app/p.class == support-v4-19.1.0.jar:android/support/v4/app/FragmentState. class]))

can you please help on how to solve the above issue

My complete build.gradle file is as follows

apply plugin: ‘android-library’

android { compileSdkVersion 19 buildToolsVersion “19.1.0”

sourceSets {

main {

manifest.srcFile ‘AndroidManifest.xml’

resources.srcDirs = [‘src’]

java.srcDirs = [‘src’]

aidl.srcDirs = [‘src’]

renderscript.srcDirs = [‘src’]

res.srcDirs = [‘res’]

assets.srcDirs = [‘assets’]


// Move the tests to tests/java, tests/res, etc…


// Move the build types to build-types/

// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, …

// This moves them out of them default location under src//… which would

// conflict with src/ being used by the main source set.

// Adding new build types or product flavors should be accompanied

// by a similar customization.


release.setRoot(‘build-types/release’) } }

dependencies { compile fileTree(dir: ‘libs’, include: ‘*.jar’) compile(group: ‘android’, name: ‘Lib1’, version: ‘3.7.5’, ext: ‘aar’) compile(group: ‘android’, name: ‘Lib2’, version: ‘2.0.2’, ext: ‘aar’) compile(group: ‘android’, name: ‘Lib3’, version: ‘1.2.7’, ext: ‘aar’) compile(group: ‘android’, name: ‘Lib4’, version: ‘2.2.1’, ext: ‘aar’) compile ‘de.greenrobot:eventbus:2.2.+’ }

and my proguard file is as follows

-keep class** { *; }

MonkeyTalk Time -dontwarn com.gorillalogic.** -keep class com.gorillalogic.** { ; } -keep interface com.gorillalogic.* { ; } -keep enum com.gorillalogic.* { *; }

To skip renaming file and method names -keepattributes SourceFile,LineNumberTable

EventBus -keepclassmembers class ** {

public void onEvent(**); }

#Skip Logger -assumenosideeffects class android.util.Log { public static *** d(…); public static *** v(…); public static *** e(…); }