Sunday, 15 July 2012

android - How to resolve java.util.zip.ZipException? -



android - How to resolve java.util.zip.ZipException? -

whever seek debug , deploy android application (in android studio 0.9) next error:

execution failed task ':app:packagealldebugclassesformultidex'. java.util.zip.zipexception: duplicate entry: android/support/multidex/buildconfig.class

to create things clear here brief history of actions:

this morning project working fine added additional classes , methods broke limit , received error: unable execute dex: method id not in [0, 0xffff]: 65536 decided add together multidex back upwards project reducing dependencies not option

since maintain getting described error after adding multidex project next post using gradle split external libraries in separated dex files solve android dalvik 64k methods limit.

here build.gradle file:

apply plugin: 'com.android.application' repositories { jcenter() } android { compilesdkversion 21 buildtoolsversion '21.1.0' defaultconfig { applicationid "com.stackoverflow.application" minsdkversion 15 targetsdkversion 21 versioncode 1 versionname "1.0" multidexenabled = true } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } dexoptions { predexlibraries = false } } afterevaluate { tasks.matching { it.name.startswith('dex') }.each { dx -> if (dx.additionalparameters == null) { dx.additionalparameters = [] } dx.additionalparameters += '--multi-dex' dx.additionalparameters += "--main-dex-list=$projectdir/<filename>".tostring() // enable main-dex-list } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile project(':viewpagerindicatorlibrary') compile 'com.google.android:multidex:0.1' compile 'com.j256.ormlite:ormlite-android:4.48' compile 'com.j256.ormlite:ormlite-core:4.48' compile 'de.greenrobot:eventbus:2.2.1' compile 'se.emilsjolander:stickylistheaders:2.5.1' compile 'joda-time:joda-time:2.5' compile 'com.makeramen:roundedimageview:1.4.0' compile 'javax.inject:javax.inject:1' compile 'com.squareup.picasso:picasso:2.3.4' compile 'com.googlecode.libphonenumber:libphonenumber:6.3.1' compile('com.google.api-client:google-api-client-gson:1.18.0-rc') { exclude module: 'httpclient' } compile 'com.google.android.gms:play-services:6.1.71' compile('com.google.api-client:google-api-client:1.17.0-rc') { exclude(group: 'xpp3', module: 'xpp3') exclude(group: 'org.apache.httpcomponents', module: 'httpclient') exclude(group: 'junit', module: 'junit') exclude(group: 'com.google.android', module: 'android') } compile('com.google.api-client:google-api-client-android:1.17.0-rc') { exclude(group: 'com.google.android.google-play-services', module: 'google-play-services') } compile('com.google.http-client:google-http-client-android:1.17.0-rc') { exclude(group: 'com.google.android', module: 'android') } compile 'com.google.guava:guava:18.0' }

i have project dependencies utilize viewpagerindicator library few jars in /libs folder:

android-async-http-1.4.6.jar guice-3.0-no_aop.jar jsr305-1.3.9.jar roboguice-2.0.jar

any advice on how resolve problem without removing of needed dependencies welcomed !

edit: bug , prepare due. see https://code.google.com/p/android/issues/detail?id=81804

i have problem too, , don't have answer. here's can add:

the class buildconfig magic class generated part of build process. reason, there exists version same fully-qualified name (android.support.multidex.buildconfig) in both mutildex-1.0.0 , multidex-instrumentation-1.0.0 aars.

i don't believe have done wrong. think symptom of beingness on cutting-edge. raised a bug report.

android gradle android-studio

No comments:

Post a Comment