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
Related
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.
Please help me to find a solution on this error.. When I build my project I got an error like this
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzbq.class
Please check ones my build.gradle(App level) file... Please give me a hint to move farword
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.realmilk.app.new"
minSdkVersion 15
targetSdkVersion 25
versionCode 6
versionName "1.0.6"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':volley')
compile project(':materialviewpager')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'io.github.yavski:fab-speed-dial:1.0.3'
compile 'com.wdullaer:materialdatetimepicker:2.2.0'
compile 'com.jaredrummler:material-spinner:1.0.5'
compile 'it.neokree:MaterialTabs:0.11'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'me.tatarka.support:jobscheduler:0.1.1'
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha2'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
testCompile 'junit:junit:4.12'
}
Please give me your valuable suggestions... Thanks
You are using 2 different versions of play service.
Change
compile 'com.google.android.gms:play-services-analytics:8.1.0'
to
compile 'com.google.android.gms:play-services-analytics:9.2.1'
So that both the auth and analytics service have same versions.
Similar question.
https://stackoverflow.com/a/38201741/3111083.
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.
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' }
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