我收到以下错误
错误:任务执行失败
:app:transformClassesWithJarMergingForDebug. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/util/DebugUtils.class
我整天都在搜索,但找不到能解决我问题的正确答案。
我的应用程序buldle gradle
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'
}
我尝试了“清理并重建”,但是那也行不通。
请帮忙。提前致谢。
最佳答案
当您添加相同的类两次时,会发生此问题。
在您的项目中,您要添加很多次support-v4库。
android-support-v4.jar
compile files('libs/android-support-v4.jar')
使用:
compile ('com.github.JakeWharton:ViewPagerIndicator:2.4.1') {
exclude module: 'support-v4'
}
关于android - Android Studio 1.5中的Gradle Build Run错误(DebugUtils.class),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36823400/