重复条目:com/android/volley/Request$Priority.class

重复条目:com/android/volley/Request$Priority.class,android,Android,我尝试了很多解决方案,但都不适合我 我在尝试生成应用程序文件时遇到此错误: 错误:任务“:app:transformClassesWithJarMergingForRelease”的执行失败。 com.android.build.api.transform.TransformException:java.util.zip.zipeException:重复条目:com/android/volley/Request$Priority.class 这是我的格拉德尔: dependencies { co

我尝试了很多解决方案,但都不适合我 我在尝试生成应用程序文件时遇到此错误:

错误:任务“:app:transformClassesWithJarMergingForRelease”的执行失败。 com.android.build.api.transform.TransformException:java.util.zip.zipeException:重复条目:com/android/volley/Request$Priority.class

这是我的格拉德尔:

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.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'  //volley http request library
compile 'com.nightonke:boommenu:2.1.0'            //navigation view
compile 'com.baoyz.pullrefreshlayout:library:1.2.0'            //refresh layout
compile 'com.github.medyo:fancybuttons:1.8.3'     //custom button
compile 'com.rengwuxian.materialedittext:library:2.1.4' //custom edittext
compile 'com.jaredrummler:material-spinner:1.1.0' //custom spinner
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.0' // progressbar button
compile 'com.alimuzaffar.lib:pinentryedittext:1.3.1'  //pin entry edit text
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.zarinpal:purchase:0.0.3-beta' 
compile 'com.android.support:multidex:1.0.1'

compile ('com.github.ganfra:material-spinner:1.1.1'){
    exclude group: 'com.nineoldandroids', module: 'library'
    exclude group: 'com.android.support', module: 'appcompat-v7'
}

testCompile 'junit:junit:4.12'

}

在Jenkins上构建时,我遇到了类似的问题,奇怪的是,它在我的本地机器上运行良好。添加以下排除后,它在本地机器和Jenkins上都起作用

android{
   configurations {
   all*.exclude group: 'com.android.volley'
   }
}
我已经将配置块添加到我的应用程序的build.gradle内的android部分

如果有关系的话,编译SDK版本是22,构建工具版本是25.0.0


这很有魅力。

我为每一个使用“扎林帕尔”的人写下这个答案。 您应该将volley库从“zarinpal库”中排除,如下所示:

compile ('com.zarinpal:purchase:0.0.3-beta'){
        exclude group: 'com.mcxiaoke.volley', module: 'library'
    } //zarinpal api 

libs
中是否有JAR?如果有,它们是什么?可能与@commonware No I重复dont@JoshuaDrake不幸的是,我在那里找不到解决方案。我遇到了刚刚在zarinpal的git中打开的问题。他们在他们的库中使用了截取,这不是最初的“截取”。你找到解决方案了吗?