android - java.util.zip.ZipException: duplicate entry -
i have been battling error day in android studio. project imported eclipse solution. have been trying implement fixes listed similar posts, nothing working. android beginner.
i happy provide further information.
error:execution failed task ':app:packagealldebugclassesformultidex'.
java.util.zip.zipexception: duplicate entry: com/google/zxing/barcodeformat.class
please help!! should try run in eclipse?
// top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.1.2' } } allprojects { repositories { jcenter() } } apply plugin: 'com.android.application' android { compilesdkversion 21 buildtoolsversion "21.1.2" defaultconfig { applicationid "com.appname.android" minsdkversion 8 targetsdkversion 18 multidexenabled true } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:support-v4:22.1.1' compile files('libs/ksoap2-android-assembly-3.1.0-jar-with-dependencies.jar') provided files('libs/zxing-core.jar') }
make sure have latest build toolds , sdk sdk manager. have converted jars
gradle
dependencies.
build.gradle
:
// top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' } // <-- added ksoap } dependencies { classpath 'com.android.tools.build:gradle:1.1.3' // <-- updated } } allprojects { repositories { jcenter() maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' } // <-- added ksoap } }
app/build.gradle
:
apply plugin: 'com.android.application' android { compilesdkversion 22 buildtoolsversion "22.0.1" // <-- updated defaultconfig { applicationid "com.appname.android" minsdkversion 8 targetsdkversion 22 // <-- updated // multidexenabled true // <-- not need } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:support-v4:22.1.1' compile 'com.google.code.ksoap2-android:ksoap2-android:3.4.0' // compile files('libs/ksoap2-android-assembly-3.1.0-jar-with-dependencies.jar') // <-- avoid using jars compile 'com.google.zxing:core:3.2.0' // provided files('libs/zxing-core.jar') // <-- avoid using jars }
Comments
Post a Comment