0

我试图建立我在Android工作室的虚拟仿真应用,我已经成功地测试了API级别21以上我现在测试较低级别的API 19,但每当我跑,我会得到这个错误:transformClassesWithJarMergingForDebug'执行失败'。 (排球)

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

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: 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:[email protected]' 
compile 'com.ogaclejapan.smarttablayout:utils-v4:[email protected]' 
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' 

我已经找到关于这一点,但许多解决方案在网上没有明确这个问题,我相信这个问题是凌空抽射,但我不能消除由于任何库到我的代码。我应该如何解决这个问题?谢谢!

回答

0

您正在使用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' 

如果类似图书馆上述两,错误仍然会保留

+0

是否可以离开这两个库?因为我在我的项目中使用了它们两个。 – JerryKo

+1

他们都是同一个库你为什么要这两个? – Redman

+0

您可能需要这些库中的独特功能? @JerryKo – Nilabja

相关问题