我收到以下錯誤搖籃建立運行錯誤(DebugUtils.class)Android Studio中1.5
錯誤:執行失敗的任務
:app:transformClassesWithJarMergingForDebug. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/util/DebugUtils.class
我找遍了整個一天,但未能找到一個適當的答案將解決我的問題。
我的應用程序的gradle bulid
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.project.test"
multiDexEnabled true
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
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:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services-ads:+'
compile 'com.google.android.gms:play-services-identity:+'
compile 'com.google.android.gms:play-services-gcm:+'
compile files('libs/android-support-v4.jar')
compile 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
}
我試圖清理和重建,但也不能正常工作。 請幫忙。提前致謝。
你有沒有試圖消除'編譯文件(「庫/ android-support-v4.jar')'從依賴關係行嗎?它似乎已經作爲fileTree行中的依賴項添加了。 –
是的,這也是阿德里安。不工作。 – Sethuraman