【发布时间】:2016-11-08 07:10:36
【问题描述】:
我收到了这个错误
错误:任务 ':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 24
buildToolsVersion "24.0.3"
useLibrary 'org.apache.http.legacy'
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "com.srgsr.gdf.bb"
minSdkVersion 14
targetSdkVersion 17
versionCode 6
versionName "1.1"
// Enabling multidex support.
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.facebook.android:facebook-android-sdk:4.2.0'
compile 'com.jaredrummler:material-spinner:1.1.0'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.github.halysongoncalves:pugnotification:1.8.1'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile 'com.google.gms:google-services:3.0.0'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:multidex:1.0.1'
compile 'swarajsaaj:otpreader:1.0'
compile files('libs/httpmime-4.1.3.jar')
// Testing dependencies
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support:support-annotations:24.2.1'
compile files('libs/urlimageviewhelper-1.0.4.jar')
}
【问题讨论】:
-
你检查过
gradle app:dependencies吗?看起来有些图书馆也在增加凌空抽射。如果你找到这样的库,你需要排除它。 -
comment 'compile 'com.android.volley:volley:1.0.0'' 然后尝试
-
你也在使用 'urlimageviewhelper-1.0.4.jar' (弃用库)使用 ion 代替:github.com/koush/ion
标签: java android gradle android-gradle-plugin build.gradle