Android Parse.com - java.util.zip.ZipException: duplicate entry: bolts/AggregateException.class - android

I have an app that works fine on the emulator but crashes on startup on the phone.
Am i right in saying i just extract the contents of the SDK folder into libs rather than have just one parse folder in libs with everything in it?
Gradle file
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.aaa.bbb"
minSdkVersion 16
targetSdkVersion 19
versionCode 30
versionName "30"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
productFlavors {
}
defaultConfig {
multiDexEnabled true
} }
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.mcxiaoke.volley:library:1.+'
compile 'com.nhaarman.listviewanimations:lib-core:3.1.0#aar'
compile 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0#aar'
compile 'com.nhaarman.listviewanimations:lib-core-slh:3.1.0#aar'
compile 'com.nononsenseapps:filepicker:+'
compile 'io.socket:socket.io-client:0.2.1'
compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.google.android.gms:play-services-analytics:7.8.0'
compile 'com.android.support:design:23.+'
compile 'com.android.support:support-v4:23.+'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
}
Log
:app:packageAllDebugClassesForMultiDex FAILED
Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: bolts/AggregateException.class

One of your libraries is using different bolts library/classes so there is some duplicate. Please use ./gradlew yourModuleName:dependencies in terminal to check dependencies tree

Related

duplicate entry: com/google/android/gms/location/places/PlaceReport

i'm having a probleme when creating the APK
When i run the app, it works fine but when i build the apk it says
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/location/places/PlaceReport.class
gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.1'
useLibrary 'org.apache.http.legacy'
configurations {
}
defaultConfig {
applicationId "inc.exemple"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.1.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.baoyz.pullrefreshlayout:library:1.2.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
compile 'com.1gravity:android-rteditor:1.6.2'
compile 'com.github.irshulx:laser-native-editor:0.3.5'
compile 'com.github.arturogutierrez:badges:1.0.5#aar'
compile 'com.mikepenz:actionitembadge:3.3.1#aar'
compile 'com.mikepenz:iconics-core:2.8.1#aar'
compile 'com.mikepenz:fontawesome-typeface:4.7.0.0#aar'
compile 'com.synnapps:carouselview:0.0.10'
compile 'com.google.firebase:firebase-messaging:9.8.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
}
I believe i should exlude it, but i don't know how, please help, thank you.
So i had to create a new empty project and copy all the libs in it, and try one by one to find which one was containing the problem. the error was coming from the com.github.irshulx:laser-native-editor:0.3.5, it worked after i deleted it, then i modified the whole project and used another work around.

Run time gradle exception

I know this is a repeated question but I tried numerous code but couldn't solve the error
Error:Execution failed for task
':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry:
android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl.class
gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.cwish"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:recyclerview-v7:23.1.0#aar'
compile 'com.daimajia.numberprogressbar:library:1.2#aar'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.koushikdutta.ion:ion:2.+'
}
I guess this problem can be resolved by removing duplicate dependencies,before removing the duplicate dependencies, you should check your modules by this command:
gradlew -q dependencies yourProject:dependencies --configuration compile
refer to this answer:duplicate dependencies problem
Hope it can help you :)
Looks like duplicate dependency problem, remove "compile 'com.android.support:recyclerview-v7:23.1.0#aar" and it'll be fine.

How to fix error when i import eclipse to android studio?(as compile-time dependency to build.gradle)

when i import project eclipse to android studio. It make error about compile. I want to try fix follow: How to add Apache HTTP API (legacy) as compile-time dependency to build.grade for Android M? But it's not working. please help me!
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/http/annotation/GuardedBy.class
file build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "vae.vnsupermark.com"
minSdkVersion 14
targetSdkVersion 23
multiDexEnabled = true
// versionCode 1
// versionName "1.0"
ndk {
moduleName "vnsm"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
// compile 'com.android.support:appcompat-v7:20.0.0'
// compile 'com.google.android.gms:play-services:+'
compile 'com.google.android.gms:play-services:4.0.30'
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/commons-io-2.4.jar')
compile files('libs/error-reporter.jar')
//compile files('libs/httpclient-4.0.1.jar')
compile files('libs/mail.jar')
compile files('libs/universal-image-loader-1.9.3.jar')
}
You should remove
compile fileTree(dir: 'libs', include: ['*.jar'])
because it will still compile the library (and all other jars in libs folder), as apparently it is not deleted from libs folder.
After this change, commenting out
//compile files('libs/httpclient-4.0.1.jar')
will really work as you expect :)

Error: Execution failed for task

I've created a project that connected to the web server parse.com
Now I encounter an error that I can not fix it
****build.gradle(Module:app)****
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.transform.api.TransformException: java.util.zip.ZipException: duplicate entry: android/support/annotation/AnimRes.class
Here is the code:
enterapply plugin: 'com.android.application'
android
{
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig
{
applicationId "app.chat.chattapp"
multiDexEnabled true
minSdkVersion 6
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
compile 'com.parse:parse-android:1.9.3'
// compile 'com.android.support:appcompat-v7:22.2.1'
// compile 'com.squareup.picasso:picasso:2.5.2'
// compile 'com.parse.bolts:bolts-android:1.+'
// compile 'com.parse:parse-android:1.+'
}
The code is
Error:Execution failed for task
':app:transformClassesWithJarMergingForDebug'.
com.android.build.transform.api.TransformException:
java.util.zip.ZipException: duplicate entry:
android/support/annotation/AnimRes.class
Problem is here , Duplicate Entry . Same Library calling 2 times.
That's why have problem .
Don't
compile 'com.parse:parse-android:1.+'
compile 'com.parse:parse-android:1.9.3'
Do
compile 'com.parse:parse-android:1.9.3'
Suggestions
Do add this
compile 'com.android.support:multidex:1.0.0'
Finally
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.9.3'
compile 'com.android.support:multidex:1.0.0'
}
Then Clean-Rebuild-Restart-Sync

Duplicate entry error - JSONPath with GSON

I am using JSONPATH library with GSON
compile 'com.google.code.gson:gson:2.5'
compile 'com.jayway.jsonpath:json-path:2.1.0'
i have used these two libraries. When i build my project, it does not show any error. But when i run my project, it shows
Error:Execution failed for task '**:app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/objectweb/asm/AnnotationVisitor.class**" error.
Can anybody help me with this?
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId ""
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName '0.2'
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.jayway.jsonpath:json-path:2.0.0'
}
This is my build.gradle.
The problem is in libraries. It shows duplicate entry of a file.
Exclude the conflicting library, e.g.:
compile ('com.jayway.jsonpath:json-path:2.2.0') { exclude group: 'org.ow2.asm' }

Categories

Resources