我尝试了很多解决方案,但它们对我不起作用当我尝试生成应用程序文件时,我会面临此错误:
错误:任务执行失败':app:transformclasseswithjarmergingforrelease'。 com.android.build.api.transform.transformexception:java.util.zip.zipexception:重复输入:com/android/volley/request $ priority.class.class.class
这是我的gradle:
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'
}
}
我已在我的应用程序的构建中添加了配置块。
如果重要的是编译SDK版本为22,并且构建工具版本为25.0.0
这就像魅力一样工作。
我为每个使用" zarinpal"的人写了这个答案。您应该只从"这样的Zarinpal库中排除射击图书馆:
:compile ('com.zarinpal:purchase:0.0.3-beta'){
exclude group: 'com.mcxiaoke.volley', module: 'library'
} //zarinpal api