Proguard in Android Studio. Getting error
I am trying to set up proguard in android studio for my release build, but I am getting the error and warnings below:
Error: Execution completed for task ': myAccount_S: proguardRelease'.
java.io.IOException: Cannot write [C: \ Users \ mgi \ AndroidStudioProjects \ MyProjects \ myAccount_S \ build \ intermediates \ classes-proguard \ release \ classes.jar] (Unable to read [C: \ Users \ MGI \ AndroidStudioProjects \ MyAccountProjects \ myAccount_S \ build \ intermediate \ parsed-AAR \ MyAccountProjects \ MyLibrary \ unset \ libs \ PushTracker-1.3.0-tracfone.jar (;;;;;;! META-INF / MANIFEST.MF)] (Duplicate zip entry [PushTracker-1.3.0-tracfone.jar: com / mgage / push / tracker / PushManager $ 1.class])): myAccount_S: proguardRelease FAILED Warning: Unable to write resource [META-INF / NOTICE] (Duplicate zip record [jackson- databind-2.2.3.jar: META-INF / NOTICE]) Warning: Unable to write resource [META-INF / LICENSE] (Duplicate zip entry [jackson-databind-2.2.3.jar: META-INF / LICENSE])
gradle:
buildTypes {
release {
minifyEnabled true
proguardFile getDefaultProguardFile('proguard-android.txt')
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/MANIFEST'
}
dependencies {
compile project (': facebookSDK') compile 'com.android.support:support-v4:19.1.0' compile 'com.android.support:appcompat-v7:19.1.0' compile 'com.google.android.gms: play-services: 6.5.87' compile files ('libs / BxLibrary-1.4.14.jar') compile files ('libs / commons-io-1.3.2.jar') compile files ('libs / jackson-annotations-2.2.3.jar') compile files ('libs / jackson-core-2.2.3.jar') compile files ('libs / jackson-databind-2.2.3.jar') compile files ('libs / libGoogleAnalyticsServices.jar') compile files ('libs / PushTracker-1.3.0.jar') compile files ('libs / robospice-1.4.14.jar') compile files ('libs / robospice-cache-1.4.14.jar')
}
source to share
The problem seems to be caused by conflicting LICENSE, NOTICE and other files. Instead of throwing an exception, check if something like this resolves:
packagingOptions {
pickFirst 'META-INF/NOTICE'
pickFirst 'META-INF/LICENSE'
pickFirst 'META-INF/MANIFEST'
pickFirst 'META-INF/LICENSE.txt'
pickFirst 'META-INF/NOTICE.txt'
pickFirst 'META-INF/MANIFEST'
}
source to share