"transformClassesWithJarMergingForDebug"的执行失败. (排球) [英] Execution failed for transformClassesWithJarMergingForDebug'. (Volley)

查看:82
本文介绍了"transformClassesWithJarMergingForDebug"的执行失败. (排球)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在android studio虚拟模拟器上构建我的应用程序,我已经在api级别21和更高级别上成功进行了测试,现在我正在测试较低级别的api 19,但是无论何时运行,我都会收到此错误:

错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败.

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com/android/volley/Request $ Priority.class

这是我的gradle文件:

 apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}
repositories {
mavenCentral()
}

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:appcompat-v7:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'dev.dworks.libs:volleyplus:0.1.4'
compile 'com.squareup.okhttp3:okhttp:3.5.0'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.android.support:design:25.1.0'
compile 'com.roughike:bottom-bar:1.2.1'
compile 'com.ncapdevi:frag-nav:1.2.2'
compile 'me.dm7.barcodescanner:zxing:1.8.4'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'net.gotev:uploadservice:3.0.3'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.journeyapps:zxing-android-embedded:3.4.0'
compile 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
compile 'com.hedgehog.ratingbar:app:1.1.2'
testCompile 'junit:junit:4.12'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'

}
apply plugin: 'com.google.gms.google-services'

我在网上找到了很多与此有关的解决方案,但并不是专门针对此问题的,我相信问题出在齐射,但是由于我的代码,我无法删除任何库.我应该如何解决这个问题?谢谢!

解决方案

您正在使用2种不同版本的凌空库

 compile 'com.android.volley:volley:1.0.0'
 compile 'com.mcxiaoke.volley:library:1.0.19'

使用以上任意一项

我不知道

compile 'dev.dworks.libs:volleyplus:0.1.4'

如果该库与以上两个库相似,则错误仍然存​​在

I am trying to build my app on android studio virtual simulator, I have successfully tested on api level 21 and above now I am testing lower level api 19, but whenever I run i will get this error:

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/android/volley/Request$Priority.class

This is my gradle file:

 apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}
repositories {
mavenCentral()
}

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:appcompat-v7:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'dev.dworks.libs:volleyplus:0.1.4'
compile 'com.squareup.okhttp3:okhttp:3.5.0'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.android.support:design:25.1.0'
compile 'com.roughike:bottom-bar:1.2.1'
compile 'com.ncapdevi:frag-nav:1.2.2'
compile 'me.dm7.barcodescanner:zxing:1.8.4'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'net.gotev:uploadservice:3.0.3'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.journeyapps:zxing-android-embedded:3.4.0'
compile 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
compile 'com.hedgehog.ratingbar:app:1.1.2'
testCompile 'junit:junit:4.12'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'

}
apply plugin: 'com.google.gms.google-services'

I have found many solution online regarding this but not specifically to this issue, I believe the problem is with volley, but I cannot remove any library due to my code. How should I solve this issue? Thank you!

解决方案

You are using 2 different versions of volley libraries

 compile 'com.android.volley:volley:1.0.0'
 compile 'com.mcxiaoke.volley:library:1.0.19'

use any one of the above

and I dont know about

compile 'dev.dworks.libs:volleyplus:0.1.4'

If that is similar library to above two ,the error will still remain

这篇关于"transformClassesWithJarMergingForDebug"的执行失败. (排球)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆