Android - Proguard Duplicate Zip Entry Error - Android Support Library
I am trying to use Proguard in an android application which uses android library projects. My core android project depends on two android library projects. The core and the librar
Solution 1:
Main Project build.gradle
:
Take some time to convert these local jars:
dependencies {
compile files('src/main/libs/sqliteassethelper-2.0.1.jar',
'src/main/libs/S3DXAndroidTools.jar',
'src/main/libs/roboguice-2.0.jar',
'src/main/libs/open-javageom.jar',
'src/main/libs/openawt.geom.jar',
'src/main/libs/libGoogleAnalyticsServices.jar',
'src/main/libs/javax.inject-1.jar',
'src/main/libs/guice-3.0-no_aop.jar',
'src/main/libs/commons-lang3-3.1.jar',
'src/main/libs/bugsense-3.6.jar')
compile fileTree(dir: "$buildDir/native-libs", include: '*.jar')
compile'com.android.support:support-v4:21.0.+'compile project(":lib/SlidingLayer")
compile project(':lib/BlutoothCommunicationHandler')
paidCompile project(':lib/Licencing')
}
To Maven Dependencies that can be managed easily(I tried to find most of them for you!):
dependencies {
// compile fileTree(dir: 'libs', include: '*.jar') // all others
compile'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'compile file('src/main/libs/S3DXAndroidTools.jar')
compile'org.roboguice:roboguice:2.0' // latest is3.0.1compile'com.google.android.gms:play-services:6.1.71' // latest is6.8.57 (issues)
compile'org.apache.commons:commons-lang3:3.3.2'compile'com.bugsense.trace:bugsense:3.6'compile fileTree(dir: "$buildDir/native-libs", include: '*.jar')
compile'com.android.support:support-v4:21.0.3'compile project(":lib/SlidingLayer")
compile project(':lib/BlutoothCommunicationHandler')
paidCompile project(':lib/Licencing')
}
After that, you should be able to use android.packagingOptions
:
packagingOptions {
exclude '.readme'
exclude 'LICENSE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/README.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
Library Project build.gradle
Your library project needs to be changed from:
dependencies {
compile"com.android.support:support-v4:19.0.+"
}
to:
dependencies {
compile'com.android.support:support-v4:21.0.3'
}
Your main issue was that you had two different com.android.support:support-v4
, one in your library project and one in your main project.
Post a Comment for "Android - Proguard Duplicate Zip Entry Error - Android Support Library"