When I try to compile my project, I get an error:
Error:Execution failed for task
':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException:
java.util.zip.ZipException: duplicate entry:
com/google/android/gms/internal/zzrn$1.class
I guess that problem concerns my dependencies. Here is a snippet of code:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.firebase:firebase-auth:9.6.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.google.android.gms:play-services-auth:9.6.1'
compile 'com.google.android.gms:play-services-plus:8.3.0'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
testCompile 'junit:junit:4.12'
I was investigating, and try with the cmd and gradlew clean, but the problem still happen.
Anyone had the same problem and can tell me what is wrong?
i found the problem, remove compile 'com.google.firebase:firebase-auth:9.6.1' and change the version 9.6.1 a 8.3.0 of compile 'com.google.android.gms:play-services-auth:9.6.1'
Related
I am getting this error
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/android/volley/AuthFailureError.class
I attached my gradle please check and help me.
android {
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile files('libs/android-async-http-1.4.4.jar')
compile files('libs/disklrucache-2.0.1.jar')
compile files('libs/google-gson.jar')
compile project(':linkedin-sdk')
compile files('libs/PGSDK_V2.0.jar')
compile 'com.android.support:support-v13:25.3.1'
compile files('libs/okhttp-1.2.1-jar-with-dependencies.jar')
compile files('libs/volley.jar')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
compile 'com.razorpay:checkout:1.4.1'
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.jjoe64:graphview:4.2.0'
}
Error:Execution failed for task
':app:transformClassesWithJarMergingForDebug'.>
com.android.build.api.transform.TransformException:
java.util.zip.ZipException: duplicate entry:
com/android/volley/AuthFailureError.class
Remove
compile files('libs/volley.jar') // From local lib also
Use
compile 'com.android.volley:volley:1.0.0'
I am using linkedin sdk,inside linkedin adk also one volley compile is
there and my app level I have one more volley dependency.
You should call volley:1.0.0 there.
Remove Below jar file from gradle
compile files('libs/volley.jar')
compile files('libs/google-gson.jar')
and compile below dependency
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.android.gms:play-services-auth:11.4.0'
this is my build.gradle,when I run app ,it report this error mesaage:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/multidex/MultiDex$V14.class
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':library')
compile project(':pullToRefreshLibrary')
compile files('libs/flame.jar')
compile files('libs/httpclient-4.2.4.jar')
compile files('libs/httpcore-4.2.4.jar')
compile files('libs/httpmime-4.2.4.jar')
compile files('libs/mp3agic.jar')
compile files('libs/libammsdk.jar')
compile files('libs/ShareSDK-Core-2.8.3.jar')
compile files('libs/oraleval-android-sdk.jar')
compile 'fm.jiecao:jiecaovideoplayer:5.5.2#aar'
compile 'com.google.code.gson:gson:2.7'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
//google play
compile 'com.uwetrottmann.photoview:library:1.2.4'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.4'
compile 'com.wdullaer:materialdatetimepicker:2.5.0'
compile 'com.getui:sdk:2.9.5.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
//Logger
compile 'com.orhanobut:logger:2.1.1'
compile files('libs/xUtils-2.6.14.jar')
compile files('libs/mta-sdk-1.6.2.jar')
compile files('libs/open_sdk_r5793.jar')
//wechat
compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:1.0.2'
//banner
compile 'com.youth.banner:banner:1.4.9'
//recyclerview
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.nineoldandroids:library:2.4.0'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//cardview
compile 'com.android.support:cardview-v7:23.1.1'
compile files('libs/AndroidPicker-1.5.3.jar')
compile 'com.tencent.bugly:crashreport:latest.release'
compile 'com.tencent.bugly:nativecrashreport:latest.release'
compile files('libs/fastjson-1.2.5.jar')
compile project(':photodraweeview')
compile 'com.facebook.fresco:fresco:0.11.0'
compile 'com.facebook.fresco:animated-gif:0.11.0'
compile 'org.litepal.android:core:1.5.0'
compile 'com.jcodecraeer:xrecyclerview:1.3.2'
compile files('libs/giisosdk.jar')
compile 'com.android.support:multidex:1.0.1'
}
First of all, you need to use the same version for support library, like this:
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
//cardview
compile 'com.android.support:cardview-v7:23.1.1'
Then try only use one of JSON library, gson or fastjson:
compile 'com.google.code.gson:gson:2.7'
//compile files('libs/fastjson-1.2.5.jar')
after the update of Android Support Repository (not sure that is related) I'm getting this error while run my application for debug:
Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException:
duplicate entry: com/google/android/gms/measurement/AppMeasurementService.class
I read many answers about similar exception but I could not find one the suit mine.
These are my library dependencies:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:support-v13:${supportLibVersion}"
compile "com.android.support:design:${supportLibVersion}"
compile "com.android.support:customtabs:${supportLibVersion}"
compile "com.android.support:recyclerview-v7:${supportLibVersion}"
compile 'com.bignerdranch.android:expandablerecyclerview:2.1.1'
compile 'com.mikepenz:iconics-core:2.5.11#aar'
compile 'com.mikepenz:google-material-typeface:2.2.0.1.original#aar'
compile('com.github.afollestad.material-dialogs:core:0.8.5.8#aar') {
transitive = true
}
compile('com.github.afollestad.material-dialogs:commons:0.8.5.8#aar') {
transitive = true
}
compile "com.google.android.gms:play-services-maps:${playServicesLibVersion}"
compile "com.google.android.gms:play-services-gcm:${playServicesLibVersion}"
compile "com.google.android.gms:play-services-location:${playServicesLibVersion}"
compile "com.google.android.gms:play-services-plus:${playServicesLibVersion}"
compile "com.google.android.gms:play-services-auth:${playServicesLibVersion}"
compile "com.google.firebase:firebase-core:${playServicesLibVersion}"
compile "com.google.firebase:firebase-ads:${playServicesLibVersion}"
compile "com.google.firebase:firebase-messaging:${playServicesLibVersion}"
compile 'com.annimon:stream:1.0.8'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile 'com.soundcloud.android:android-crop:1.0.1#aar'
compile files('libs/azure/notificationhubs/notification-hubs-0.4.jar')
compile files('libs/azure/notifications/notifications-1.0.1.jar')
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.squareup.okhttp:okhttp:2.6.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.6.0'
compile 'com.google.code.gson:gson:2.6.2'
compile ('org.simpleframework:simple-xml:2.7.1') {
exclude group: 'xpp3', module: 'xpp3'
exclude group: 'stax', module: 'stax-api'
exclude group: 'stax', module: 'stax'
}
compile 'com.facebook.conceal:conceal:1.0.1#aar'
compile 'com.facebook.android:facebook-android-sdk:4.8.1'
compile 'me.tatarka.bindingcollectionadapter:bindingcollectionadapter:1.0.1'
compile 'me.tatarka.bindingcollectionadapter:bindingcollectionadapter-recyclerview:1.0.1'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'jp.wasabeef:glide-transformations:1.3.1'
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
}
And these are my app dependencies:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':core')
compile "com.android.support:cardview-v7:${supportLibVersion}"
compile 'com.github.rey5137:material:1.2.2'
compile 'net.opacapp:multiline-collapsingtoolbar:1.0.0'
compile 'jp.wasabeef:recyclerview-animators:2.2.0'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
apt "org.parceler:parceler:1.0.4"
compile 'org.parceler:parceler-api:1.0.4'
compile 'com.android.support:multidex:1.0.1'
}
I know that I'm supposed to remove a dependency that cause the conflict but I don't know which one I've to remove.
Need help :)
Thanks in advance
EDIT
I've notice right now that from Android Studio, in the Project tab, inside External Libraries there is the play_services_measurement_8_3_0 that I've not included anywhere. During build I can also see this line:
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement830Library
I've recently included the firebase library inside my project so I think that the problems is here....maybe...but I'm not able to remove it. How can I fix that?
Logcat Error:
Error:Execution failed for task ':app:packageAllLocalVersionDebugClassesForMultiDex'.>java.util.zip.ZipException: duplicate entry: bolts/AggregateException.class
App Gradle Dependency:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.jeremyfeinstein.slidingmenu:library:1.3#aar'
compile 'com.daimajia.swipelayout:library:1.1.8#aar'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.traex.rippleeffect:library:1.3'
compile 'com.facebook.fresco:fresco:0.9.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile project(':floating_button_library')
compile 'com.facebook.android:facebook-android-sdk:4.10.0'
}
After adding the dependency for Facebook SDK the build throws an Exception
suggest me an answer thanks..
EDIT:
SOLVED THE ERROR
Now they split bolts-android into bolts-applinks and bolts-tasks .so you need exclude both from the gradle build
compile ('com.facebook.android:facebook-android-sdk:4.10.0'){
exclude group: 'com.parse.bolts',
module: 'bolts-tasks'
exclude group: 'com.parse.bolts',
module: 'bolts-applinks';}
This works perfectly for me !!!!
there were two DIFFERENT versions of it conflicting. the facebooksdk
comes with bolts-android-1.1.x and appcompatv7 comes with 1.1.x.
so add below line,
compile ('com.facebook.android:facebook-android-sdk:4.10.0'){
exclude module: 'bolts-android'
exclude module: 'support-v4'
}
Hil all,
this my error :
Error:Class android.support.v4.app.ActivityCompatHoneycomb has already
been added to output. Please remove duplicate copies.
and my dependecies are :
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.android.support:support-v4:22.0.0') {
exclude group: 'com.android.support', module: 'support-v4'
}
compile ('com.google.android.gms:play-services:7.0.0')
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/json-simple-1.1.1.jar')
compile files('libs/ormlite-android-4.45.jar')
compile files('libs/ormlite-core-4.45.jar')
compile files('libs/jackson-databind-2.1.4.jar')
compile files('libs/jackson-core-2.1.4.jar')
compile files('libs/jackson-annotations-2.1.4.jar')
compile files('libs/httpmime-4.1.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/paralloidviews.jar')
compile files('libs/jsr250-api-1.0.jar')
compile project(':volley')
compile project(':Android-RSS-Reader-Library-master')
compile project(':facebook')
compile project(':Forecast')
compile project(':headerListView')
compile project(':library-sliding-menu')
compile files('libs/panoramagl.jar')
compile project(':paymentKit_lib')
compile project(':ProgressWheel-master')
compile project(':UIL_library')
compile files('libs/coverflowlibrary.jar')
}
so where I could find the duplacte copies, can you help me please, I struggle with this error a long time ago !
This is most probably happening because one of your library projects already contains support-v4. Try to remove compile('com.android.support:support-v4:22.0.0') from your dependencies and check. This should solve the problem